模式查找查询中的猫鼬模式

时间:2020-09-11 11:04:06

标签: mongoose find

我有会议室模式,其中包含所有会议室详细信息和typeSchema, 我需要在查询中按类型搜索。

const RoomtypeSchema = new Schema({
    type: { type: String},
    price: { type: Number}

});




This is the schema
const RoomSchema = new Schema({

name: { type: String, require: true },
type: RoomtypeSchema,
roomNumb:{type:String, require:true},
isAvailable:{type:Boolean, default:true},
roomDescription:String,
maxOccupancy:{type:Number, require:true}

});

0 个答案:

没有答案