New Raw Query Result for the Java SDK

Latest version of our Java SDK (2.3.3 at the time of writing) introduces a new class: RawQueryExecutor. It gives you the direct result of a N1QL or FTS query as a JSON String or JsonObject, just like if you were using the REST API directly. The answer is not wrapped in rows. As such you can pass the result of the method directly to your client. No need for additional mapping or anything.

This is particularly useful for N1QL queries as it allows you to query exactly what you need through the SELECT clause. It is very efficient combined with the right covering indexes.

Here's the asynchronous code sample:

and the synchronous one:

I would love to know if you find it useful and if you want this also for simpler operations. Tell us what you think!

Share this article
Get Couchbase blog updates in your inbox
This field is required.

Author

Posted by Laurent Doguin

Laurent is a nerdy metal head who lives in Paris. He mostly writes code in Java and structured text in AsciiDoc, and often talks about data, reactive programming and other buzzwordy stuff. He is also a former Developer Advocate for Clever Cloud and Nuxeo where he devoted his time and expertise to helping those communities grow bigger and stronger. He now runs Developer Relations at Couchbase.

Leave a comment

Ready to get Started with Couchbase Capella?

Start building

Check out our developer portal to explore NoSQL, browse resources, and get started with tutorials.

Use Capella free

Get hands-on with Couchbase in just a few clicks. Capella DBaaS is the easiest and fastest way to get started.

Get in touch

Want to learn more about Couchbase offerings? Let us help.