Reputation: 369
I have an array like
const names = ["mike","alice","jesse"];
i have document
{
"name":"alice", // could be any name
"age":17,
"occupation":"engineer",
}
now I want to match names from array and if they match then I update the document. I have quite long array and more than 500 documents.
Upvotes: 0
Views: 72
Reputation: 468
you may try this if names array is to big.
if(names. indexof(incoming_name) > -1){
//update query with where name:incoming_name
}
Upvotes: 1