Pattern search for the in query

My actual issue is something similar but I am giving a simple class to explain it better.

I want to get a list of all persons who have some keywords in their hobbies (for example hockey- case insensitive search)

The Java class for my model is and I am saving individual hobby to lower case

class Person {

String name;

List<String> hobbies;

}

Using the following shell command works

db.person.find({"hobbies":{$in:[/hockey/]}})

However I am not able to make the same thing work using Spring-data-mongodb (version 3.2.4).

Hi @ragarwal1_N_A
Welcome to the Community!!

Can you please share a sample data along with expected and actual response for the above query?

Thanks
Aasawari