arnaucube
arnaucube/thoughtsPublic Self-hosted repository
thoughts/node_modules/mongoose/examples/mapreduce/person.js
node_modules/mongoose/examples/mapreduce/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  });
15  mongoose.model('Person', PersonSchema);
16};