I'm using $regex in mongoose, a however a bit confused with its behavior.
Here's my data, I have one document which has one attribute "owner" as below.
{ "owner" : "lorem ipsum" }
now when I do search with {owner: {$regex:"",$options:"i"}} in MongoDB compass it returns that object, and when I do {owner: ""}, it returns nothing.
So can somebody explain to me why this behavior is like this, I do not have an empty string as an owner though while doing $regex it returns that document.
Even I tried to remove space between lorem and "epsum" as "loremepsum" but it had the same behavior. Shouldn't it return same as {owner: ""} ?