I want to create a query in MongoDB to to find documents by and array of objects which exactly math document property.
I have documents:
{meta: {prop1: "hi1", prop2: "ho1"}},
{meta: {prop1: "hi2", prop2: "ho2"}},
{meta: {prop1: "hi3", prop2: "ho3"}},
{meta: {prop1: "hi1", prop2: "ho2"}}
I want to find documents whose meta property is one of exact objects in this array:
[
{prop1: "hi1", prop2: "ho1"}, {prop1: "hi2", prop2: "ho2"}
]
Desired result would be documents:
{meta: {prop1: "hi1", prop2: "ho1"}},
{meta: {prop1: "hi2", prop2: "ho2"}}
but not:
{meta: {prop1: "hi1", prop2: "ho1"}},
{meta: {prop1: "hi2", prop2: "ho2"}},
{meta: {prop1: "hi1", prop2: "ho2"}}