Join Query for working with spring boot

Hi, i am trying to write code on spring boot to use join query.
This is what i have:
“SELECT * FROM #{#n1ql.bucket} AS f LEFT OUTER JOIN #{#n1ql.bucket} AS c ON f.category = meta( c ).id WHERE META(f).id = $1”
List<?> findByQuery(String id);

And I got error like this:

java.lang.NullPointerException\n\tat$ReactiveFindByQuerySupport.lambda$null$1(\n\tat reactor.core.publisher.FluxMap$MapSubscriber.onNext(\n\tat reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(\n\tat reactor.core.publisher.FluxMap$MapSubscriber.onNext(\n\tat reactor.core.publisher.EmitterProcessor.drain(

can someone point out what is wrong with my code? Thanks!

@eln Does your query work from Query Work Bench of the UI?

yes, it works from Query Work Bench.

Hi @ein -

queries need to have __cas and __id projected.

@Query("SELECT 0 as “+TemplateUtils.SELECT_CAS +”, ‘’ as "’ as “+TemplateUtils.SELECT_ID+” , MAX(…

public class TemplateUtils {
public static final String SELECT_ID = “__id”;
public static final String SELECT_CAS = “__cas”;See

I’ve opened NullPointerException in @Query that do not project __cas . Should check for this explicitly · Issue #1097 · spring-projects/spring-data-couchbase · GitHub to handle this better.

Hi @mreiche
do i have to use reactive repository to handle the join query or can i just use the couchbase repository?

Either will work. The CouchbaseRepository uses the ReactiveCouchbaseRepository.

it works, thanks for helping!