Initial commit
This commit is contained in:
commit
f47e08fdcb
2409 files changed
+363607
No files matched your search
+17
@@ -0,0 +1,17 @@
|
||||
|
||||
// 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);
|
||||
};
|
||||
Reference in new issue
Block a user