I am trying to get executionStats of a Particular mongo aggregate query. I run db.command but that doesn't give "execution status"
This is what I am trying to do. how to get Python Mongo Aggregate explain using db.command?
pymongo aggregate don't allow explain option
This worked for me:
db.command(
'explain',
{
'aggregate': coll_name,
'pipeline': your_pipeline,
'cursor': {}
},
verbosity='executionStats'
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With