I want to query something with SQL\'s like query:
like
SELECT * FROM users WHERE name LIKE \'%m%\'
How to do I achieve the same in
As Mongo shell support regex, that's completely possible.
db.users.findOne({"name" : /.*sometext.*/});
If we want the query to be case-insensitive, we can use "i" option, like shown below:
db.users.findOne({"name" : /.*sometext.*/i});