I am trying to find records in my database using my service and this works:
def resultList = IndividualRecord.findAllWhere(citizenship: 'us')
but when I change citizenship to upper case, like this:
def resultList = IndividualRecord.findAllWhere(citizenship: 'US')
it no longer works. So I tried this:
def resultList = IndividualRecord.findAllWhere(citizenship.caseIgnoreEquals('us'))
but that doesn't work. Any suggestions? citizenship is a String property of class IndividualRecord.
This will match the citizenship field against 'US' case insensitively
def resultList = IndividualRecord.findAllByCitizenshipIlike('US')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With