|
@@ -7,6 +7,7 @@ const goodsTags = {
|
|
label: { type: String, required: false, zh: '显示名称' }, //
|
|
label: { type: String, required: false, zh: '显示名称' }, //
|
|
code: { type: String, required: false, zh: '标签编码' }, //
|
|
code: { type: String, required: false, zh: '标签编码' }, //
|
|
pid: { type: String, required: false, zh: '上级标签' }, //
|
|
pid: { type: String, required: false, zh: '上级标签' }, //
|
|
|
|
+ level: { type: Number, required: false, zh: '层级' }, //
|
|
status: { type: String, required: false, default: '0', zh: '状态' }, // 字典:use
|
|
status: { type: String, required: false, default: '0', zh: '状态' }, // 字典:use
|
|
};
|
|
};
|
|
const schema = new Schema(goodsTags, { toJSON: { getters: true, virtuals: true } });
|
|
const schema = new Schema(goodsTags, { toJSON: { getters: true, virtuals: true } });
|
|
@@ -15,6 +16,7 @@ schema.index({ 'meta.createdAt': 1 });
|
|
schema.index({ label: 1 });
|
|
schema.index({ label: 1 });
|
|
schema.index({ code: 1 });
|
|
schema.index({ code: 1 });
|
|
schema.index({ pid: 1 });
|
|
schema.index({ pid: 1 });
|
|
|
|
+schema.index({ level: 1 });
|
|
schema.index({ status: 1 });
|
|
schema.index({ status: 1 });
|
|
|
|
|
|
schema.plugin(metaPlugin);
|
|
schema.plugin(metaPlugin);
|