Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client = MongoClient("Localhost",27017) # Set Mongo Client to local hose
- db = client.Assignment # Set db as the DB required
- collection = db.project # Set the collection to the collection required
- Version = float(input("Enter version number: "))
- query = {"prod.v_num": Version}
- Return = collection.find(query)
- for doc in Return:
- print(doc["_id"], "¦", doc["prod"]["name"], "¦", doc["prod"]["v_num"], "¦",doc["owner"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement