couchbase_lite
couchbase_lite copied to clipboard
`lower` function support for Expression
Is your feature request related to a problem? Please describe. I'm trying to query users by name like %something%.
var query = QueryBuilder.select([SelectResult.all()])
.from(CouchbaseHelper.databaseName!)
.where(Expression.property("name")
.like(Expression.string("%test%"))));
It works, but it is case sensitive. So I searched in couchbase forum how to do a case insensitive query and found this:
SELECT * FROM contacts WHERE lower(last_name) = “smith”;
Describe the solution you'd like I think the solution would be something like:
where(Expression.lower(Expression.property("name"))
.like(Expression.string("%test%")));
Describe alternatives you've considered I don't have other ideas. Feel free to suggest something...
Hi,
Already exists:
(Functions.lower(Expression.property("description")).like(Expression.string("%${searchTerm.toLowerCase()}%")))
@arnzuk for some reason it is not working...
it only works when the case matches exactly.
Is there any way of using raw queries? Just to make sure