Get the dataset from a "returning" clause using the Java SDK

java
n1ql

#1

I’m executing a N1ql query that has a “returning” clause, but I can’t seem to find a way to access that data using the Java client. Is there something special that you have to do?


#2

A RETURNING * clause should produce rows(), just like a SELECT so that should work out of the box.


#3

Hi @simonbasle - that is what I thought too, but that does not seem to be the case. Try it for yourself.


#4

what is the query you are trying to execute, and what is the SDK version you are using?


#5

@vibelifeinc I did try, and there’s even a test for RETURNING clause: https://github.com/couchbase/couchbase-java-client/blob/9800c35badbbcffbd5a20038e3f4bb8af85005f2/src/integration/java/com/couchbase/client/java/N1qlDmlTest.java#L129-L129

That’s why I need to know if you’re doing anything more specific, or maybe using an older version of the SDK that might explain why returned data isn’t visible to you…


#6

I got it to work. Thanks.