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