Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Commit d7eb541

Browse files
committed
support explain
1 parent efe99b9 commit d7eb541

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

handlers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ def _find(self, args, out, name = None, db = None, collection = None):
227227

228228
cursor.sort(stupid_sort)
229229

230+
if 'explain' in args and bool(args['explain'][0]):
231+
out(json.dumps({"results" : [cursor.explain()], "ok" : 1}, default=json_util.default))
232+
230233

231234
if not hasattr(self, "cursors"):
232235
setattr(self, "cursors", {})

0 commit comments

Comments
 (0)