Suppose I have a document collection
{ "id":1, "arr":[{"a":1, "b":2, "c":3}, {"a":6, "b":0, "c":8},....]}
{ "id":2, "arr":[{"a":7, "b":1, "c":4}, {"a":5, "b":2, "c":6},....]}
Now the user will provide me with an array of unknown size like this
let user_id: 2;
let user_arr = [{"a":7, "b":1, "c":9}, {"a":1, "b":6, "c":3},.....]
Now I want to push user provided arr documents in user's arr
for user_id
given by user such that (a,b) combination of both values will not be duplicated for him/her.
For e.g - for above case as (a:7, b:1)
already exist in arr
so It won't get inserted, but for (a:1, b:6)
no record contains both of them that's why it {"a":1, "b":6, "c":3}
gets inserted in the arr.
Please help me, anyone.