MongoDB Print Pretty with PyMongo
This question already has an answer here:
PyMongo fetches the documents as Python data structures. So you can use pprint
with it like this:
from pprint import pprint
cursor = collection.find({})
for document in cursor:
pprint(document)
链接地址: http://www.djcxy.com/p/50238.html
下一篇: MongoDB打印漂亮与PyMongo