Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mongodb #python #documents
ADD COMMENT
Topic
Name
3+3 =