Suppose there is a Schema and there is a field
phoneNumber:{
type:[String],
required:true
},
now i want to compare this column with an array , example ["ABC","DEF"]. How can i check if any element in this array matches with an element in a document
Like if there are documents A = { phoneNumber :["ACD, "BFG"]} and B= {phoneNumber:["GCD"]}
The query should return the B document if i check using C= ["GCD"], as B is the only document that contains "GCD" element.
I did try to use myDoc.find({phoneNumber:{$in:["GCD"]}) but it isnt returning anything. What is the correct query which is to be used