-
Notifications
You must be signed in to change notification settings - Fork 192
Closed
Labels
type: bugA general bugA general bug
Milestone
Description
Using Spring Data Repository interface with paginated methods, count queries to retrieve the number of total items are executed without removing the sort parameter, causing the following error in response:
[
{
"code": 4210,
"msg": "Expression (<sorting field>) must depend only on group keys or aggregates.",
"query": "<count query with order by>"
}
]
Here you can see that the original query is modified to perform the count by removing skip and limit, but not the sort parameter:
https://github.com/spring-projects/spring-data-couchbase/blob/main/src/main/java/org/springframework/data/couchbase/repository/query/CouchbaseQueryExecution.java#L152
Here you can see that the sort order is added even if isCount is true
https://github.com/spring-projects/spring-data-couchbase/blob/main/src/main/java/org/springframework/data/couchbase/core/query/Query.java#L290
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug