Please how can I make this work on mongoDB. For each item in an array, fetch data which contains the item from another collection.
For example:
"users" : [{ "name": "John doe", "age": 51 }, { "name": "Jake kim", "age": 50 }, { "name": "Jim son", "age": 51 }]
On another collection I have
"age": [50,51,52,53,54]
Now my desire result is
"50" : [{ "name": "Jake kim", "age": 50 }], "51" : [{ "name": "John doe", "age": 51 }, { "name": "Jim son", "age": 51 }]