Skip to content

Count queries field name requirement regression [DATACOUCH-649] #960

Closed
@spring-projects-issues

Description

@spring-projects-issues

Eduard Dudar opened DATACOUCH-649 and commented

With Spring Data Couchbase 3.x I had a few custom counting queries written like

@Query("SELECT COUNT(*) FROM ... WHERE ...")

but upon upgrading to 4.x the same code fails with #block terminated with an error and an error being NPE in mapper. While inspecting closer what's going on, I can see that ReactiveFindByQueryOperationSupport.count() has this mapping operation

row -> row.getLong(TemplateUtils.SELECT_COUNT)

and expects a field named count but Couchbase returns $1: 0. Changing queries to

@Query("SELECT COUNT(*) AS count FROM ... WHERE ...")

works but I haven't found any requirement in the docs for this and it is working with 3.x so I feel like this is a regression


No further details from DATACOUCH-649

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions