Spring boot couchbase 4.1.1 reading dynamic field names

Hi Team,

I am using sdk 3.0 and spring boot data couchbase 4.1.1 versions in my application.

here i want to use distinct, count n1ql queries and also i need to fetch the fieldnames from Document.
By using the latest 3.0 and spring boot couchbase 4.1.1, we were not able to write the query in java 1.8. Could some one help me on this.

Thanks in Advance.
K Kumaravel

You can write the query yourself in n1ql https://www.couchbase.com/products/n1ql using the @Query annotation, or have the query derived from the method named. ‘Distinct’ is recognized in the method name and method names that begin with ‘count’ are assumed to be ‘count’ queries.

git clone git@github.com:spring-projects/spring-data-couchbase.git

See -

./src/test/java/org/springframework/data/couchbase/domain/AirportRepository.java: List<Airport> findDistinctIcaoBy();
./src/test/java/org/springframework/data/couchbase/domain/AirportRepository.java: List<Airport> findDistinctIcaoAndIataBy();
./src/test/java/org/springframework/data/couchbase/domain/AirportRepository.java: Long countDistinctIcaoAndIataBy();
./src/test/java/org/springframework/data/couchbase/domain/AirportRepository.java: Long countDistinctIcaoBy();

Thanks. I will look into it and update.