S
S
Sergey2014-09-18 18:57:27
MongoDB
Sergey, 2014-09-18 18:57:27

How to choose the most appropriate documents for a query in mongo?

In general, a question was asked at an interview a long time ago, I thought I’d come and google it, but I came and forgot.
Now I remembered. The essence of the question was something like this, they say there are collections with articles, the article has tags.
It is necessary to make a request in the mongo console, which would display the titles of the articles in order, which are the closest tags in the search.
Well, for example, there are tags in the request: "obama, bananas, sanctions, dzhigurda."
And there are articles with titles and tags: "Obama eats bananas", "Dzhigurda imposed sanctions", "Putin rejected sanctions", "Obama and Dzhigurda eat bananas". Well, there the tags are probably the same, separated by commas. I don’t remember exactly the syntax, and it’s not the essence of what you need to read. To make search queries for the closest values ​​\u200b\u200bfor the parameters? And to make a nodo with a request to the console,
Chaotically described, but I think you understand.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Vasiliev, 2014-09-18
@butteff

Apparently, something of this was meant:
docs.mongodb.org/manual/core/index-text
docs.mongodb.org/manual/reference/operator/query/text

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question