Answers for "mongodb get all documents in collection in a colection python"

Go
1

mongodb python get all documents

from pymongo import MongoClient

if __name__ == '__main__':
    client = MongoClient("localhost", 27017, maxPoolSize=50)
    db = client.localhost
    collection = db['chain']
    cursor = collection.find({})
    for document in cursor:
          print(document)
Posted by: Guest on September-01-2021
4

get all data in collection mongodb

db.collection_name.find().pretty()
Posted by: Guest on November-04-2020

Code answers related to "mongodb get all documents in collection in a colection python"

Browse Popular Code Answers by Language