Last active
August 29, 2015 14:01
-
-
Save konsumer/6c492e17da45f9f3b8bd to your computer and use it in GitHub Desktop.
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(process.env.MONGO_URI); | |
mongoose.connection.on('error', function(e){ | |
console.log('Mongoose Error:', e) | |
}); | |
var Tester = mongoose.model('Tester', new mongoose.Schema({ | |
cool: Boolean | |
})); | |
var test = new Tester({cool:true}); | |
test.save(function(er){ | |
if(er){ | |
console.log('error:', er); | |
return; | |
} | |
console.log(test); | |
mongoose.connection.close(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment