Skip to content

Instantly share code, notes, and snippets.

@MisguidedGhostt
Created September 23, 2019 21:51
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db=client['empresa'] #Abre la db
num_emp= input('Ingresa el numero de empleado: ')
nombre = raw_input('Ingresa el nombre del empleado: ')
sueldo = input('Ingresa el sueldo del empleado: ')
puesto = raw_input('Ingresa el puesto del empleado: ')
document = {"num_emp":num_emp, "nombre":nombre, "sueldo":sueldo, "puesto":puesto}
_id = db['empleados'].insert(document)
print _id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment