Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. client = MongoClient("Localhost",27017) # Set Mongo Client to local hose
  2.  
  3. db = client.Assignment # Set db as the DB required
  4. collection = db.project # Set the collection to the collection required
  5.  
  6. Version = float(input("Enter version number: "))
  7.  
  8. query = {"prod.v_num": Version}
  9.  
  10. Return = collection.find(query)
  11.  
  12. for doc in Return:
  13. print(doc["_id"], "¦", doc["prod"]["name"], "¦", doc["prod"]["v_num"], "¦",doc["owner"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement