|
@@ -14,6 +14,9 @@ const goods = {
|
|
view_num: { type: Number, required: false, default: 0, zh: '浏览量' }, //
|
|
view_num: { type: Number, required: false, default: 0, zh: '浏览量' }, //
|
|
status: { type: String, required: false, default: '0', zh: '商品状态' }, // 字典:goods_status
|
|
status: { type: String, required: false, default: '0', zh: '商品状态' }, // 字典:goods_status
|
|
act_tags: { type: Array, required: false, zh: '活动标签' }, // 字典:act_tags
|
|
act_tags: { type: Array, required: false, zh: '活动标签' }, // 字典:act_tags
|
|
|
|
+ sort: { type: Number, required: false, default: 0, zh: '排序' }, //
|
|
|
|
+ source: { type: String, required: false, zh: '来源' }, //
|
|
|
|
+ url: { type: String, required: false, zh: '网址' }, //
|
|
};
|
|
};
|
|
const schema = new Schema(goods, { toJSON: { getters: true, virtuals: true } });
|
|
const schema = new Schema(goods, { toJSON: { getters: true, virtuals: true } });
|
|
schema.index({ id: 1 });
|
|
schema.index({ id: 1 });
|
|
@@ -23,6 +26,7 @@ schema.index({ name: 1 });
|
|
schema.index({ status: 1 });
|
|
schema.index({ status: 1 });
|
|
schema.index({ view_num: 1 });
|
|
schema.index({ view_num: 1 });
|
|
schema.index({ act_tags: 1 });
|
|
schema.index({ act_tags: 1 });
|
|
|
|
+schema.index({ sort: 1 });
|
|
|
|
|
|
schema.plugin(metaPlugin);
|
|
schema.plugin(metaPlugin);
|
|
|
|
|