我有会议室模式,其中包含所有会议室详细信息和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}
});