Skip to content

Commit

Permalink
Also keep find options around when explaining the query in mongodb, t…
Browse files Browse the repository at this point in the history
…his solves issue with queries always reporting indexOnly=false
  • Loading branch information
amol- committed Aug 22, 2014
1 parent f6bfd5f commit b3607a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tgext/debugbar/controller.py
Expand Up @@ -83,7 +83,9 @@ def perform_ming(self, collection, command, params, duration, modify=None):
for i, step in enumerate(command.split('.')):
if step == 'find':
args = query_params[i]
cursor = session.find(collection, args)
query = args[0]
options = args[1]
cursor = session.find(collection, query, **options)
else:
args = query_params[i]
cmd = getattr(cursor, step)
Expand Down
2 changes: 1 addition & 1 deletion tgext/debugbar/sections/mingorm.py
Expand Up @@ -35,7 +35,7 @@ def cursor_created(self, cursor, action, *args, **kw):
cursor.tgdb_class = inspect.isclass(
args[0]) and args[0].__name__ or args[0]
try:
cursor.tgdb_args = [args[1]]
cursor.tgdb_args = [[args[1], kw]]
except:
cursor.tgdb_args = [{}]
elif action in ('limit', 'sort', 'skip', 'hint'):
Expand Down

0 comments on commit b3607a8

Please sign in to comment.