Case Insensitive `like`

In CBL 2.0, is there any option to make like match to be case insensitive? If not, is there any Expression function to change the string value of a field to be lower case?

You can add a Collate to your IExpression, like this:

var myQuery = QueryBuilder.Select(SelectResult.Expression(Meta.ID))

I use Collate like this on an OrderBy, haven’t tried it on a Like yet myself.

1 Like

Yes , there is . You can read about it in the examples in this blog

 let searchQuery = QueryBuilder
            .and(Function.lower("name")).like(Expression.string("royal engineers museum"))))

thanks! this is a great workaround!

good to know about Collate function. thanks!