I had list of ids in array
Employees array
let employeeIds= [
ObjectId("5b0d4c5ec47e6223a08af5fd"),
ObjectId("5b1625f762368179e1e4549c"),
ObjectId("5b3a15979a68763230202dfd"),
ObjectId("5b3b0ea9074f944699f1bcfc"),
ObjectId("5b45eb1214e42414cc9a2191"),
ObjectId("5b83e3fc6fcad70850159ae2"),
ObjectId("5bdc5a8ab8d82616a54b5667"),
ObjectId("5bdc5b43d9c22617406f5b4d"),
ObjectId("5bdd3a9da9ad6b138b503d7d"),
ObjectId("5bf7e3840c414b4a1612da36"),
ObjectId("5c18d04256573a536a201599"),
ObjectId("5c18d05b56573a536a2015a2"),
ObjectId("5ba8c52a5e0e986f16102c6f"),
ObjectId("5ba34247decd71414691021d"),
ObjectId("5bdd3d0ccf9d1417166e47ec")
]
In my mongodb stores collection, there are list of employees in array
{
"_id" : ObjectId("5b0d3fa6b426ea12ec0f6e5a"),
"name" : "xxxx",
"email" : "[email protected]",
"telephone" : "24301212",
"mobile" : "+91********",
"employees" : [
ObjectId("5b0d4c5ec47e6223a08af5fd"),
ObjectId("5b45eb1214e42414cc9a2191"),
ObjectId("5b3b0ea9074f944699f1bcfc"),
ObjectId("5b1625f762368179e1e4549c"),
ObjectId("5b83e3fc6fcad70850159ae2"),
ObjectId("5bdc5a8ab8d82616a54b5667"),
ObjectId("5bdc5b43d9c22617406f5b4d"),
ObjectId("5bdd3a9da9ad6b138b503d7d"),
ObjectId("5b3a15979a68763230202dfd"),
ObjectId("5bf7e3840c414b4a1612da36"),
ObjectId("5c18d04256573a536a201599"),
ObjectId("5c18d05b56573a536a2015a2")
],
}
I need to compare employees array in my store employees collection with mongodb query. I tried using find() the store & using lodash to took the employees who are all match in this store collections. How can I do with in this query? Can you please suggest any idea?