Skip to content

QueryCriteria TRUE() to N1QL is behaving differently in version 4.4.5 #1627

@amitnimbhorkar

Description

@amitnimbhorkar

The SpEl query extraction/preparation is behaving wrong after upgrade from spring-data-couchbase:3.2.6.RELESE to spring-data-couchbase:4.4.5. The keyword IsTrue/True is expected to be transformed as 'field = TRUE', but it does not. Instead it just adds the field to the query as shown below.

This causes queries perform badly since they don’t pick expected indexes plus possible invalid results.

Before :
Optional findByIdAndStatusAndActiveDocumentTrue(String id, String status);

query: SELECT _class, id, META(bucket).id AS __id,…. FROM bucket WHERE _class = "com.blah.UserDocument" AND id = $1 and status = $2 and activeDocument = true

After:
Optional findByIdAndStatusAndActiveDocumentTrue(String id, String status);

query: SELECT _class, id, META(bucket).id AS __id,…. FROM bucket WHERE _class = "com.blah.UserDocument" AND id = $1 and status = $2 and activeDocument

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions