M
M
Max Payne2018-12-15 00:54:34
MongoDB
Max Payne, 2018-12-15 00:54:34

How to organize such a search in MongoDB?

In Posgtresql (and SQL in general) I used the view construct
'some_text' LIKE CONCAT('%', name, '%')
to find the occurrence of a cell in arbitrary text. The same could be done using regex, but how can I do it with MongoDB?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2018-12-15
@VladimirAndreev

db.users.find({"name": /.*m.*/})
By the very first link from Google for "mongodb like"...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question