Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

mongodb in python

# install the pymongo module through pip or some other package manager

from pymongo import MongoClient

client = MongoClient("<mongodb uri>") 
db = client.example_database # you can also do 'client["example_database"]'
collection = db.example_collection

for i in collection.find(): # returns a list of documents in the collection
	print(i) # print collection document
 
PREVIOUS NEXT
Tagged: #mongodb #python
ADD COMMENT
Topic
Name
5+8 =