Skip to content

Is there any way to custom how basic operators work instead of creating a new one? #184

@vnlan

Description

@vnlan

For example, when comparing datetime:

lastUpdated=="2025-08-05T17:00:00.000Z"

I want to compare equal day only but not the time. So I convert it to date >= inputDate and date < inputDate like the code below:

 case RsqlBasicOperator.EQUAL: {
                return switch (argument) {
                    case LocalDateTime ldtArg when type.equals(LocalDateTime.class) -> builder.and(
                            builder.greaterThanOrEqualTo(path.as(LocalDateTime.class), ldtArg),
                            builder.lessThan(path.as(LocalDateTime.class), ldtArg.plusDays(1))
                    );
                    default -> builder.equal(path, argument);
                };

Is there any way I can do that with this library? Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions