|
@@ -11,12 +11,14 @@ const user = {
|
|
password: { type: Secret, required: false, select: false, zh: '密码' }, //
|
|
password: { type: Secret, required: false, select: false, zh: '密码' }, //
|
|
icon: { type: Array, required: false, zh: '头像' }, //
|
|
icon: { type: Array, required: false, zh: '头像' }, //
|
|
birth: { type: String, required: false, zh: '生日' }, //
|
|
birth: { type: String, required: false, zh: '生日' }, //
|
|
|
|
+ openid: { type: String, required: false, zh: '微信小程序' }, //
|
|
};
|
|
};
|
|
const schema = new Schema(user, { toJSON: { getters: true, virtuals: true } });
|
|
const schema = new Schema(user, { toJSON: { getters: true, virtuals: true } });
|
|
schema.index({ id: 1 });
|
|
schema.index({ id: 1 });
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
schema.index({ name: 1 });
|
|
schema.index({ name: 1 });
|
|
schema.index({ phone: 1 });
|
|
schema.index({ phone: 1 });
|
|
|
|
+schema.index({ openid: 1 });
|
|
|
|
|
|
schema.plugin(metaPlugin);
|
|
schema.plugin(metaPlugin);
|
|
|
|
|