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
Already u got the answers but to match regex with case insensitivity
You could use the following query
db.users.find ({ "name" : /m/i } ).pretty()
The i in the /m/i indicates case insensitivity and .pretty() provides a more pretty output
i
/m/i
.pretty()