mongodb python get all documents

Solutions on MaxInterview for mongodb python get all documents by the best coders in the world

showing results for - "mongodb python get all documents"
Rudy
01 Nov 2018
1from pymongo import MongoClient
2
3if __name__ == '__main__':
4    client = MongoClient("localhost", 27017, maxPoolSize=50)
5    db = client.localhost
6    collection = db['chain']
7    cursor = collection.find({})
8    for document in cursor:
9          print(document)