You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>"
}
]
The text was updated successfully, but these errors were encountered:
pirimpeo
changed the title
Repository Paged Query - Sort parameter not removed on count query
Repository Paged Query - Sort parameter not removed in count query
Aug 17, 2021
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:
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
The text was updated successfully, but these errors were encountered: