[MONGO] I have a collection of places which is like this :
[
{ item: "journal",tags: ["blank", "red","blue","yellow"]},
{ item: "notebook",tags: ["red", "pink","green"]},
{ item: "paper", tags: ["red", "blank", "plain","black"]},
{ item: "planner",tags: ["blank", "blue","gray"]},
{ item: "postcard",tags: ["blue"] }
]
I want search for tags with 1 array search:["red", "blank","black"], how to get items, which the tags contains at least 1 element on aray search. and sorting .
expect result:
[
{ item: "paper",tags: ["red", "blank", "plain","black"]},
{ item: "journal",tags: ["blank", "red","blue","yellow"]},
{ item: "notebook",tags: ["red", "pink","green"]},
{ item: "planner", tags: ["blank", "blue","gray"]},
]