How to do NOT LIKE in mongoDB?
$paddress = new MongoRegex("/kendriya/");
$caddress = new MongoRegex("/India/");
Array
(
[$and] => Array
(
[0] => Array
(
[permanent_address] => Array
(
[$not] => $paddress
)
)
[1] => Array
(
[current_address] => Array
(
[$not] => $caddress
)
)
)
)
I want implement $nin
with regex to full text search but $nin
and $regex
not worked together.
Update: this is not a duplicate question. When I pass above array then result not getting because it is encode into json then it is convert into as
$and :
[
{ permanent_address: { $not: "/kendriya/" } } ,
{ current_address: { $not: "/India/" } }
]
}
]
result not getting from above json array but actual mongodb syntax is
$and :
[
{ permanent_address: { $not: /kendriya/ } } ,
{ current_address: { $not: /India/ } }
]
}
]
so how can I solve this?