Skip to content

lower function support for Expression #107

@igorcafe

Description

@igorcafe

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions