Skip to content
Browse files

Merge pull request #35 from nathanfolkman/master

Add support for hint to find().
  • Loading branch information...
2 parents 0b0d48f + 52c1ac8 commit b537cf1137cb82d0a0a0b411b67a30ddc0b31ce4 @jehiah jehiah committed Jan 25, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 asyncmongo/cursor.py
View
8 asyncmongo/cursor.py
@@ -269,7 +269,7 @@ def find_one(self, spec_or_id, **kwargs):
def find(self, spec=None, fields=None, skip=0, limit=0,
timeout=True, snapshot=False, tailable=False, sort=None,
max_scan=None, slave_okay=False,
- _must_use_master=False, _is_command=False,
+ _must_use_master=False, _is_command=False, hint=None, debug=False,
callback=None):
"""Query the database.
@@ -366,14 +366,18 @@ def find(self, spec=None, fields=None, skip=0, limit=0,
self.__max_scan = max_scan
self.__slave_okay = slave_okay
self.__explain = False
- self.__hint = None
+ self.__hint = hint
+ self.__debug = debug
# self.__as_class = as_class
self.__tz_aware = False #collection.database.connection.tz_aware
self.__must_use_master = _must_use_master
self.__is_command = _is_command
connection = self.__pool.connection()
try:
+ if self.__debug:
+ print u'QUERY_SPEC: {}'.format(self.__query_spec())
+
connection.send_message(
message.query(self.__query_options(),
self.full_collection_name,

0 comments on commit b537cf1

Please sign in to comment.
Something went wrong with that request. Please try again.