I have collections of the following structure:
objects:
[{"type": "someTypeOne", "menuId": 1},
{"type": "someTypeTwo", "menuId": 1},
{"type": "someTypeOne", "menuId": 2}]
menus:
[{"id":1, "type": "someTypeOne"},
{"id":2, "type": "someTypeOne"}]
I need to find all objects where "type" property doesn't match its menus "type". In this case the desired output would be:
[{"type": "someTypeTwo", "menuId": 1}]
I think that I should use aggregation for this one and I'm fiddling with it at the moment but I was not able to formulate a working query so far. Thanks