Reputation: 1521
I am trying to write a spring boot query(with mongoDb) in the repository where I want one of the arguments needs to be case insensitive
I can use something like this but then personId
also becomes case insensitive and it does not allow the Boolean
argument.
public Family findByNameAndPersonIdAndActiveIgnoreCase(String name, String personId, Boolean active);
A compound query or some annotation should also work.
Upvotes: 1
Views: 904
Reputation: 39978
Just specify the IgnoreCase
to only the property that need case insensitive
public Family findByNameIgnoreCaseAndPersonIdAndActive(String name, String personId, Boolean active);
Upvotes: 2