How to search a column in a collection in mongodb with $in which includes an array of elements for search and also caseInsensitive matching of thos
$in
caseInsensitive
The way to do it in Java is:
List nameList = Arrays.asList(name.split(PATTERN)); List regexList = new ArrayList<>(); for(String name: nameList) { regexList.add(Pattern.compile(name , Pattern.CASE_INSENSITIVE)); } criteria.where("Reference_Path").in(regexList);