Last active
August 29, 2015 14:03
-
-
Save thebergamo/2c01084e07325b59cc4b to your computer and use it in GitHub Desktop.
subdoc
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'); | |
var Schema = mongoose.Schema; | |
//loading required Schemas | |
var departamentsSchema = mongoose.model('departments').schema;//require('./departaments'); | |
var badgesSchema = mongoose.model('badges').schema; //require('./badges'); | |
var permissionsSchema = mongoose.model('badges').schema;//require('./permissions'); | |
//user schema | |
var userSchema = new Schema({ | |
email: String, | |
name: { | |
first:String, | |
last: String | |
}, | |
profile: { | |
born: Date, | |
otherInfo: String, | |
}, | |
badges: [badgesSchema], | |
departments: [departamentsSchema], | |
permissions: [permissionsSchema] | |
}); | |
mongoose.model('user', userSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment