I have this HomeSchema
Schema = mongoose.Schema;
homeSchema = new Schema({
name: { type: String, required: true},
administrator: {type : mongoose.Schema.Types.ObjectId, ref: 'User', required: true},
users: [{ type : mongoose.Schema.Types.ObjectId, ref: 'User' }],
});
module.exports = mongoose.model('Home', homeSchema);
I want to query whether a specific user in that users array based on user._id? I know this is rather simple, but how do I do this? Do I have to use $elematch?