This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |