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!

Autor

A ordem da postagem em relação a outras postagens. Laurent Doguin, Advogado do desenvolvedor, Couchbase

Laurent é um Developer Advocate baseado em Paris, onde se concentra em ajudar os desenvolvedores Java e a comunidade francesa. Ele escreve código em Java e postagens de blog em Markdown. Antes de se juntar ao Couchbase, ele era o contato da comunidade Nuxeo, onde dedicou seu tempo e experiência para ajudar toda a comunidade Nuxeo a se tornar mais ativa e eficiente.

Posição vertical a partir do topo para iniciar o corte como uma porcentagem da altura da imagem.