Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from pymongo import MongoClient
- try:
- conector = MongoClient("192.168.111.134",27017)
- bd = conector.curso
- coleccion = bd.libros
- """
- coleccion.insert_one({
- "titulo":"Lorem Ipsum",
- "año":2020,
- "metadatos":['Jhon Doe','Suspenso'],
- "tags":['ubicación','demo']
- })
- """
- print(coleccion.find_one({"tags":"demo"}))
- except Exception as e:
- sys.exit(e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement