How to check if an array has the same elements as another one in mongodb aggregation
I need to match all documents where field arr, which is an array of object Ids, has same elements of a given one no matther the position. I tried: [ { $match:{ arr: givenArr } } ] or [ {…