I have documents in mongodb are like :
[{
"_id" : 1,
"name" : "Himanshu",
"tags" : ["member", "active"]
},{
"_id" : 2,
"name" : "Teotia",
"tags" : ["employer", "withdrawal"]
},{
"_id" : 3,
"name" : "John",
"tags" : ["member", "deactive"]
},{
"_id" : 4,
"name" : "Haris",
"tags" : ["employer", "action"]
}]
- What I want to search here is if we have array of filter like
{"tags" : ["member", "act"]}it will reply back id's1and2because herememberis full match andactpartial match in two documents. - if I have filter like
{"tags" : ["mem"] }then it should reply id's1and3 - One more case If I have filter like
{"tags" : ["member", "active"]}then it should answer only1.