I can see the statistics from Mongo shell as
db.stats()
or
db.collection_name.stats()
How do I view statistics of a database, or of a collection, from PHP and Python.
EDIT: I have done it in PHP but still cant do it in Python.
Help?
I can see the statistics from Mongo shell as
db.stats()
or
db.collection_name.stats()
How do I view statistics of a database, or of a collection, from PHP and Python.
EDIT: I have done it in PHP but still cant do it in Python.
Help?
This is how you do it in PHP
But how to do this in python?
This is PHP code to execute
dbStats
command with newMongoDB
driver:The easiest way I have found to do this with a Mongoengine model was this:
This should allow transparent changes in the collection and database using mongoengine's config settings.
This is how you do it in
Python
if you are using thePyMongo
driver:References: