Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update __init__.py #17

Merged
merged 3 commits into from

2 participants

@japerk

kwargs for find_one that pass thru to find

japerk added some commits
@japerk japerk Update __init__.py
kwargs for find_one that pass thru to find
24bbee9
@japerk japerk Update __init__.py
spec
3f5905d
@vmalloc
Owner

Hey!

It appears the travis job for mongomock was broken (my bad). Can you please rebase on master so that we can make sure the tests pass?

Thanks

@japerk japerk Update __init__.py
add sort kwarg to find
98f4d02
@vmalloc vmalloc merged commit a22ab79 into vmalloc:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 3, 2013
  1. @japerk

    Update __init__.py

    japerk authored
    kwargs for find_one that pass thru to find
  2. @japerk

    Update __init__.py

    japerk authored
    spec
Commits on Apr 4, 2013
  1. @japerk

    Update __init__.py

    japerk authored
    add sort kwarg to find
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 mongomock/__init__.py
View
6 mongomock/__init__.py
@@ -181,7 +181,7 @@ def update(self, spec, document, upsert = False, manipulate = False,
document.update(spec)
self.insert(document)
- def find(self, spec = None, fields = None, filter = None):
+ def find(self, spec = None, fields = None, filter = None, sort = None):
if filter is not None:
_print_deprecation_warning('filter', 'spec')
if spec is None:
@@ -202,9 +202,9 @@ def _copy_only_fields(self, doc, fields):
def _iter_documents(self, filter = None):
return (document for document in itervalues(self._documents) if self._filter_applies(filter, document))
- def find_one(self, filter = None):
+ def find_one(self, spec=None, **kwargs):
try:
- return next(self.find(filter))
+ return next(self.find(spec, **kwargs))
except StopIteration:
return None
Something went wrong with that request. Please try again.