example: route, controller, model
This commit is contained in:
14
server/models/model.js
Normal file
14
server/models/model.js
Normal 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);
|
||||
Reference in New Issue
Block a user