Skip to content

Instantly share code, notes, and snippets.

@tsongas
Created February 13, 2015 17:26
Show Gist options
  • Save tsongas/1670b7b38289371cbe06 to your computer and use it in GitHub Desktop.
Save tsongas/1670b7b38289371cbe06 to your computer and use it in GitHub Desktop.
Mongoose
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