So, I'm using mongodb and trying to do a search for a substring in a key, if any document contains the substring it should return the document withing the query.
This is what im using:
db.events.find({name: '\.*substring\.'})
But it only matches some names, not every name that contains the substring...
I've tried using the $text and $search operator, but it seems that it only queries if I input the whole name, not the substring.