I have the following function, which is quite complicated, but i’m hoping someone might be able to understand it help me simplify/speed it up. In this function i end up with an array that contains a list of primaryStores and the number of products coming from each one to my group of stores. However, it only counts the products, if
Tag: aggregate
mongodb – match if a group of values from an array is in another given array [with Aggregation]
I’m looking for a solution since 3 hours and I don’t get it yet. I have the following collection: and I would like to have only the documents that have all the index values in a given array like for example [1,2,4] using the example above, I would like to have the following output: [1,2] is in [1,2,4] -> OK