【发布时间】:2020-09-25 07:59:16
【问题描述】:
我有一个像这样的猫鼬模式:
const userSchema = new Schema( {
email:{ type: String, required: true, unique:true, index:true },
mobile:{ type: String },
phone:{ type: String },
firstname: { type: String },
lastname: { type: String },
profile_pic:{type:String},
socialHandles: {
type: Map,
of: String
},
active: {type:Boolean, default:true}
}, {
timestamps: true
} );
我想查询“给我用户 where socialHandles.instagram=jondoe”我该怎么做? 请帮忙
【问题讨论】:
标签: mongodb mongoose mongodb-query mongoose-schema