arnaucube
arnaucube/thoughtsPublic Self-hosted repository
thoughts/node_modules/mongoose/examples/aggregate/person.js
node_modules/mongoose/examples/aggregate/person.jsRaw
 1
 2// import the necessary modules
 3var mongoose = require('../../lib');
 4var Schema = mongoose.Schema;
 5
 6// create an export function to encapsulate the model creation
 7module.exports = function() {
 8  // define schema
 9  var PersonSchema = new Schema({
10    name: String,
11    age: Number,
12    birthday: Date,
13    gender: String,
14    likes: [String]
15  });
16  mongoose.model('Person', PersonSchema);
17};