Created
February 13, 2015 17:26
-
-
Save tsongas/1670b7b38289371cbe06 to your computer and use it in GitHub Desktop.
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 mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/test'); | |
var Cat = mongoose.model('Cat', { name: String }); | |
var kitty = new Cat({ name: 'Zildjian' }); | |
kitty.save(function (err) { | |
if (err) // ... | |
console.log('meow'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment