Created
April 10, 2015 22:34
-
-
Save LateButEarly/493120a91bfc64f6b9bf to your computer and use it in GitHub Desktop.
mongodb example for csc200
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