I'm using PyMongo to access MongoDB and I want to make some speed tests. However, the fact MongoDB uses cache makes it harder for me to do that. I know it's possible to clear cache using the Mongo Shell (I hope that's what I need) - but I can't find how to do that using PyMongo. Is it even possible? Thank you
Here's how to execute the PlanCache.clear()
command in PyMongo:
db.command(
{
"planCacheClear": "collection_name"
}
)
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