I want to make a query in mongodb for searching a string in another string. Now the use case is I have document like:
{
"names":"[John,Mike,Stephen,Rock]"
}
Now I want to make a filter which will search for :
- Case-1: If John is present in names or not
- Case-2: If John and Mike both are present in this string
I am quite new to mongodb. I went through many posts, but I haven't got any satisfactory results as of now. Some are using regex or text search.Can anyone help in making the query