As we know cursor in mongoDB can be defined as return value of query run to mongoDB. The information of can be display using cursor.explain() function as show in below:
db.collection.find().explain()
The explain() method returns a document with the query plan and, optionally, the execution statistics. The output of this command look like:
{
"cursor" : "BasicCursor",
"isMultiKey" : false,
"n" : 45,
"nscannedObjects" : 45,
"nscanned" : 45,
"nscannedObjectsAllPlans" : 45,
"nscannedAllPlans" : 45,
"scanAndOrder" : false,
"indexOnly" : false,
"nYields" : 2,
"nChunkSkips" : 0,
"millis" : 74,
"server" : "my-pc:27017",
"filterSet" : false
}
0 Comment(s)