filestore.js 374 B

123456789101112
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const SchemaDefine = {
  4. filePath: { type: String, required: true },
  5. name: { type: String, required: true },
  6. fileName: { type: String, required: true },
  7. };
  8. const schema = new Schema(SchemaDefine);
  9. module.exports = app => {
  10. const { mongoose } = app;
  11. return mongoose.model('filestore', schema, 'filestore');
  12. };