diff options
Diffstat (limited to 'common/src/main/webapp/usageguide/appserver/node_modules/mongoose/examples/aggregate/person.js')
-rw-r--r-- | common/src/main/webapp/usageguide/appserver/node_modules/mongoose/examples/aggregate/person.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/examples/aggregate/person.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/examples/aggregate/person.js new file mode 100644 index 0000000..607bb07 --- /dev/null +++ b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/examples/aggregate/person.js @@ -0,0 +1,17 @@ + +// import the necessary modules +var mongoose = require('../../lib'); +var Schema = mongoose.Schema; + +// create an export function to encapsulate the model creation +module.exports = function() { + // define schema + var PersonSchema = new Schema({ + name: String, + age: Number, + birthday: Date, + gender: String, + likes: [String] + }); + mongoose.model('Person', PersonSchema); +}; |