Files
Superalgos/server/node_modules/mongoose/examples/querybuilder/person.js
T
2018-09-03 15:19:57 +02:00

18 lines
373 B
JavaScript

// import the necessary modules
'use strict';
const mongoose = require('../../lib');
const Schema = mongoose.Schema;
// create an export function to encapsulate the model creation
module.exports = function() {
// define schema
const PersonSchema = new Schema({
name: String,
age: Number,
birthday: Date
});
mongoose.model('Person', PersonSchema);
};