Filter data using mongoose populate
问题 I have two data structures "database" and "components" const DatabaseSchema = mongoose.Schema({ components: [{ type: Schema.Types.ObjectId, ref: 'Components', required: false }], }); const ComponentsSchema = mongoose.Schema({ name: { type: String, required: true, trim: true, unique: true, lowercase: true }, updatedAt: Date, }); I want to filter all items in the database by component names search rule I'm using Database.find({ components: { $elemMatch: { name: /antr/i } } }).populate({ path: