PageRenderTime 22ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/node_modules/mongoose/examples/globalschemas/person.js

https://bitbucket.org/coleman333/smartsite
JavaScript | 14 lines | 10 code | 1 blank | 3 comment | 0 complexity | 4c191897e4ee44825d7466332d98781e MD5 | raw file
 1// import the necessary modules
 2var mongoose = require('../../lib');
 3var Schema = mongoose.Schema;
 4
 5// create an export function to encapsulate the model creation
 6module.exports = function() {
 7  // define schema
 8  var PersonSchema = new Schema({
 9    name: String,
10    age: Number,
11    birthday: Date
12  });
13  mongoose.model('Person', PersonSchema);
14};