PageRenderTime 23ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/node_modules/mongoose/examples/querybuilder/person.js

https://bitbucket.org/coleman333/smartsite
JavaScript | 15 lines | 10 code | 2 blank | 3 comment | 0 complexity | 320486e117b23f2c7bf85649e74af7b2 MD5 | raw file
 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};