Skip to content

Instantly share code, notes, and snippets.

@thebergamo
Created August 1, 2014 15:52
Show Gist options
  • Save thebergamo/d1be6469f685b20cc9cf to your computer and use it in GitHub Desktop.
Save thebergamo/d1be6469f685b20cc9cf to your computer and use it in GitHub Desktop.
Referencia usando Mongoose
var user1 = {name: 'Marcos', group: 'kjeshjiuytrdcvbnj'};
var user1 = {name: 'Vinicius', group: 'kjeshjiukjhgfkjhgfj'};
model.find({}).remove(function(){
model.create(user1,function(err,doc){
if(err)
console.log(err);
model.create(user2, function(err, doc){
model.find({}).exec(function(err, data){
if(err)
console.log(err);
console.log(data) ;
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment