Created
August 1, 2014 15:52
-
-
Save thebergamo/d1be6469f685b20cc9cf to your computer and use it in GitHub Desktop.
Referencia usando Mongoose
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
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