this question is very similar to another post
I basically want to use the mongodb version of the sql \"like\" \'%m%\' operator
but in my situation i\'m using
if(searchType.equals("employeeId")) {
query.addCriteria(Criteria.where(searchType).regex(java.util.regex.Pattern.compile(searchValue)));
employees = mongoOperations.find(query, Employee.class, "OfficialInformation"); }