Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
Add support for $comment in find().
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Kustarz committed Aug 8, 2012
1 parent 2fa1288 commit 07c59d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion asyncmongo/cursor.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def find(self, spec=None, fields=None, skip=0, limit=0,
timeout=True, snapshot=False, tailable=False, sort=None, timeout=True, snapshot=False, tailable=False, sort=None,
max_scan=None, slave_okay=False, max_scan=None, slave_okay=False,
_must_use_master=False, _is_command=False, hint=None, debug=False, _must_use_master=False, _is_command=False, hint=None, debug=False,
callback=None): comment=None, callback=None):
"""Query the database. """Query the database.
The `spec` argument is a prototype document that all results The `spec` argument is a prototype document that all results
Expand Down Expand Up @@ -367,6 +367,7 @@ def find(self, spec=None, fields=None, skip=0, limit=0,
self.__slave_okay = slave_okay self.__slave_okay = slave_okay
self.__explain = False self.__explain = False
self.__hint = hint self.__hint = hint
self.__comment = comment
self.__debug = debug self.__debug = debug
# self.__as_class = as_class # self.__as_class = as_class
self.__tz_aware = False #collection.database.connection.tz_aware self.__tz_aware = False #collection.database.connection.tz_aware
Expand Down Expand Up @@ -436,6 +437,8 @@ def __query_spec(self):
spec["$explain"] = True spec["$explain"] = True
if self.__hint: if self.__hint:
spec["$hint"] = self.__hint spec["$hint"] = self.__hint
if self.__comment:
spec["$comment"] = self.__comment
if self.__snapshot: if self.__snapshot:
spec["$snapshot"] = True spec["$snapshot"] = True
if self.__max_scan: if self.__max_scan:
Expand Down

0 comments on commit 07c59d5

Please sign in to comment.