Mongo DB aggregation with array of objects
问题 My collection schema is as follows: Product { _id: ObjectId(), // default mongo db id specification: [ {key: 'Name', value: "value 1"}, {key: 'Category', value: "value 2"}, {key: 'Department', value: "value 3"} ] } Now I want to query on this with a generic filter. For example, Get me all product with Name = value 1 and Category in [value 2, value 3] and Department = value 3 Get me all product with Name = value 1 or Category = value 2 or Department in [value 3, value 4] I have been trying to