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
As a workaround, you can create inline @query and add DISTINCT clause and empty __id and __cas values:
@Query("SELECT DISTINCT ' ' as `__id`, 0 as `__cas`, name from #{#n1ql.bucket} WHERE #{#n1ql.filter} AND `creator` = $1 ")
List<Component> findDistinctNameByCreator(String creator);
The expectation is to receive the same output as CouchbaseTemplate does:
BTW - such a method name without a predicate (i.e. findDistinctIcao()) fails to generate a derived method. findAllDistinctIcao() also fails. This is an issue with the framework, not spring-data-couchbase.
Distinct fields in CouchbaseRepository methods are ignored by Couchbase N1ql statement generator
As a workaround, you can create inline @query and add DISTINCT clause and empty __id and __cas values:
The expectation is to receive the same output as CouchbaseTemplate does:
Request:
Take into consideration the Distinct fields for generating dynamic n1ql queries from repository methods.
The text was updated successfully, but these errors were encountered: