|
@@ -3,7 +3,7 @@ const Schema = require('mongoose').Schema;
|
|
|
const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
|
|
|
|
|
|
-const DataimpSchema = {
|
|
|
+const TasksSchema = {
|
|
|
userid: { type: String, required: true, maxLength: 64 },
|
|
|
name: { type: String, required: false, maxLength: 200 },
|
|
|
createtime: { type: String, required: false, maxLength: 20 },
|
|
@@ -14,11 +14,11 @@ const DataimpSchema = {
|
|
|
};
|
|
|
|
|
|
|
|
|
-const schema = new Schema(DataimpSchema, { toJSON: { virtuals: true } });
|
|
|
+const schema = new Schema(TasksSchema, { toJSON: { virtuals: true } });
|
|
|
schema.index({ userid: 1 });
|
|
|
schema.plugin(metaPlugin);
|
|
|
|
|
|
module.exports = app => {
|
|
|
const { mongoose } = app;
|
|
|
- return mongoose.model('Dataimp', schema, 'data_imp');
|
|
|
+ return mongoose.model('Tasks', schema, 'tasks');
|
|
|
};
|