- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDBconnectionTutorial1.py
More file actions
Latest commit
24 lines (17 loc) · 690 Bytes
/
Copy pathDBconnectionTutorial1.py
File metadata and controls
24 lines (17 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'''
https://docs.mongodb.org/getting-started/python/
'''
frompymongoimportMongoClient
client=MongoClient("mongodb://root:root@ds025379.mlab.com:25379/lumin")
db=client['lumin']
users=db.users
cursor=users.find()
fordocumentincursor:
printdocument
print"--------------------------------------------------------------------------"
print"--------------------------------------------------------------------------"
cursor_1=users.find({"username":"mkyong" })
fordocumentincursor_1:
printdocument
print"--------------------------------------------------------------------------"
print"--------------------------------------------------------------------------"