[12:16:10] <Dwarf> Is there anyone with experience with the java connector? I'm trying to do something like https://stackoverflow.com/a/18908725 but the syntax is a bit vague for me and the documentation doesn't seem to clear it up
[19:58:36] <cdignam> Anyone know how to run explain on a distinct query in pymongo?
[19:59:06] <GothAlice> cdignam: “distinct query” — is that a query what is distinct, or an actual attempt to retrieve “DISTINCT” values for a given field?
[19:59:24] <GothAlice> (That is, the range of populated values, choices, or possibilities.)
[19:59:47] <cdignam> like, db.collection.distinct('username, {'some_field: 5}). How do I run explain on this?
[20:07:37] <GothAlice> cdignam: In the REPL shell (“mongo” command)? You can see exactly what any given function does there. Just type the name of the function by itself: db.foo.distinct<enter>
[20:08:34] <GothAlice> cdignam: In this case, it’s issuing a “raw command” ({disintct: …, key: …, query: …}). Don’t think you can EXPLAIN that. You can, however, take the query being used (“filter document”), and issue an explain of it directly.
[20:09:34] <GothAlice> Or, possibly, ask for an explanation of the resulting cursor. On that one, maybe.
[20:10:42] <GothAlice> Yup, the distinct() function there doesn’t return the result, it retrieves it in its entirety.
[20:11:24] <GothAlice> So, issue a normal find, issuing the same query, and .explain() that.