I apologize in advance if this question is asked, I searched, I can not find the answer.
I want to do a search in MongoDB, and create an index and do something like
db.myCollection.runCommand( "text", { search: "myWord" } )
This works great.
I can also do
db.myCollection.runCommand( "text", { search: "myWord1 myWord2" } )
and he will search for both words.
Can I perform the above search by asking to find BOTH words? (I know that I can search by the first word, and then search by the second by result, but I wonder if there is a better way).
In addition, is it possible to indicate the words to be rejected (for example, to search for the word "test", but not for "testing").
I would like to know if I can do this in mongoDB without using external tools.
source
share