I execute the follow mongodb command in mongo shell
db.coll.aggregate(...)
and i see the list of result. but is it possible to see the quer
Try .explain("executionStats"):
db.inventory.find(
{ quantity: { $gte: 100, $lte: 200 } }
).explain("executionStats")
Which returns a very detailed JSON with the time in "executionTimeMillis" like:
{
"queryPlanner" : {
...
},
"executionStats" : {
"executionSuccess" : true,
"nReturned" : 3,
"executionTimeMillis" : 0,
...
More details: https://docs.mongodb.com/manual/tutorial/analyze-query-plan/#evaluate-the-performance-of-a-query