example: route, controller, model

This commit is contained in:
Ben Elferink
2020-12-22 02:11:43 +02:00
parent d389451be2
commit fedda7b932
4 changed files with 50 additions and 1 deletions

14
server/models/model.js Normal file
View File

@@ -0,0 +1,14 @@
import mongoose from 'mongoose';
const instance = new mongoose.Schema({
/*
name = property of document object
String = type of value ---> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures
*/
name: String,
});
// document = model name ---> https://mongoosejs.com/docs/guide.html
const document = 'example';
export default mongoose.model(document, instance);