Skip to content

Instantly share code, notes, and snippets.

@Carayav
Created October 17, 2017 15:34
Show Gist options
  • Select an option

  • Save Carayav/ea8f3dae84f91bddd43e90b0881927f7 to your computer and use it in GitHub Desktop.

Select an option

Save Carayav/ea8f3dae84f91bddd43e90b0881927f7 to your computer and use it in GitHub Desktop.
function createDefaultMedicos(){
Medico.find({}).exec(function(err, collection) {
if(collection.length === 0) {
Medico.create({
run:'2654073-9',
nombre: 'pedro gonzales',
especialidad: 'espec 1',
email: 'correoDoctor1@example.com'});
Medico.create({
run:'14943899-8',
nombre: 'juan muñoz',
especialidad: 'espec 2 ',
email: 'correoDoctor2@example.com'});
Medico.create({
run:'15880543-K',
nombre: 'diego rojas',
especialidad: 'espec 3',
email:'correoDoctor1@example.com'});
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment