I have data in my db in the form:
{term: "Hello how"}, {term: "whoever"}, {term:"who"}
I have an array of strings like:
["Hello how are you", "whoever has done this please let me know"]
I want to write a query in mongo db that will fetch all the substrings for these array of strings in the fastest way.
So the result I’m expecting for this is [“Hello how”,”whoever”]
I have tried with regex:
Hello|how|are|you|whoever|has|done|this|please|let|me|know
but this did not work because this matched individual words
New contributor
Mahes Dwivedi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.