Skip to content

Instantly share code, notes, and snippets.

@stephencweiss
Created November 21, 2018 20:00
An example find() command on a DB with 10m documents with an index explained
//mongo sh
db.descriptions.find( {productId: {$gt : 9999990 } } ).explain("executionStats")
{
"queryPlanner" : {
"plannerVersion" : 1,
"namespace" : "trailblazer.descriptions",
"indexFilterSet" : false,
"parsedQuery" : {
"productId" : {
"$gt" : 9999990
}
},
...
},
"executionStats" : {
"executionSuccess" : true,
"nReturned" : 10,
"executionTimeMillis" : 1,
"totalKeysExamined" : 10,
"totalDocsExamined" : 10,
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment