Created
May 7, 2011 17:49
-
-
Save jmoyers/960683 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
// Assume we're in ~/project/models/ | |
var mongoose = require('mongoose'), | |
Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId; | |
var User = new Schema({ | |
email : String | |
, password : String | |
, name : String | |
}); | |
mongoose.model('User', User); | |
module.exports = mongoose.model('User'); |
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
// Assume we're in ~/project/ | |
var User = require('./models/user.js'); | |
var u = new User(/** some properties and whatnot **/); | |
u.save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment