I am using pymongo driver to work with Mongodb using Python. Every time when I run a query in python shell, it returns me some output which is very difficult to understand. I have used the .pretty()
option with mongo shell, which gives the output in a structured way.
I want to know whether there is any method like pretty()
in pymongo, which can return output in a structured way ?
I want to know whether there is any method like
pretty()
in PyMongo
No PyMongo doesn't provide such method. It is only available in the shell.
You need to use the pprint
function from the pprint
module.
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