Pretty printing of output in pymongo

前端 未结 4 1746
太阳男子
太阳男子 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:21

    No direct method to print out of pymongo in a structured way.

    as the out of pymongo is dict

    print(json.dumps('variable with out of pymongo query'))

    this will serve your purpose i think

提交回复
热议问题