模式查找查询中的Mongoose模式

模式查找查询中的Mongoose模式,mongoose,find,Mongoose,Find,我有房间模式,其中包含所有房间细节和类型模式, 我需要运行一个查询,它在其中按类型进行搜索 const RoomtypeSchema = new Schema({ type: { type: String}, price: { type: Number} }); This is the schema const RoomSchema = new Schema({ name: { type: String, require: true }, type: Roomtype

我有房间模式,其中包含所有房间细节和类型模式, 我需要运行一个查询,它在其中按类型进行搜索

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}
}))