Concept of getting documents from mongodb is working in get_doc.py
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import pymongo
|
||||
import getpass
|
||||
|
||||
myclient = pymongo.MongoClient("mongodb://admin:pass@localhost:27017/")
|
||||
username = input("Username :")
|
||||
#password = getpass.getpass("Password: ")
|
||||
|
||||
mydb = myclient["groclist_db"]
|
||||
mycol = mydb["groclist_users"]
|
||||
|
||||
email = mycol.find_one({"username": username}, {"_id": 0, "name": 1, "email": 1})
|
||||
|
||||
print (email)
|
||||
Reference in New Issue
Block a user