i need to do regex bases search on a single field which has a condtion "ab not dc". below query results error. suggest a proper query to use
db.getCollection('collection').aggregate(
[
{$match:{search_description:{$regex: "ab", "$options": "i"}}}
,{$match:{search_description:{$not:{$regex: "dc", "$options": "i"}}}}
]
)
above query results "errmsg" : "bad query: BadValue $not cannot have a regex" error message