Pretty printing of output in pymongo

前端 未结 4 1753
太阳男子
太阳男子 2021-01-12 17:25

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 difficul

4条回答
  •  情歌与酒
    2021-01-12 18:19

    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.

提交回复
热议问题