Greetings. I have a collection with a lot of entries and I’m trying to make it so I can search in it by text, without having to use the exact content of a field. I have created a text index for it, indicating which fields contain text that should we search in.
It seemed to work fine for the first few times, but then I noticed it only works if there are multiple words in the matching field. If it’s a single word, it won’t return anything unless I type the exact word, which is what I am trying to avoid.
My current code:
client.db.itemdata.findOne( { $text: { $search:
\"${input}\"
, $caseSensitive: false } } )
Here is a screenshot to help present the issue. Any help is appreciated