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
Use aggregation substring search (with index!!!):
db.collection.aggregate([{ $project : { fieldExists : { $indexOfBytes : ['$field', 'string'] } } }, { $match : { fieldExists : { $gt : -1 } } }, { $limit : 5 } ]);