Skip to content

Commit

Permalink
index creation
Browse files Browse the repository at this point in the history
DOC-11539
  • Loading branch information
RichardSmedley authored Oct 17, 2023
1 parent 3d0d751 commit 5eed5a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/howtos/pages/n1ql-queries-with-sdk.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ include::example$SimpleQuery.java[tag=class,indent=0]
--
====

Let's break it down. A query is always performed at the `Cluster` level, using the `query` method. It takes the statement as a required argument and then allows to provide additional options if needed (in the example above, no options are specified).
Note that building indexes is covered in some detail on the xref:concept-docs:n1ql-query.adoc#index-building[Query concept page], which you should take a quick look at --
and in the https://docs.couchbase.com/sdk-api/couchbase-java-client/com/couchbase/client/java/manager/query/package-summary.html[API Reference].

Let's break down the above code snippet.
A query is always performed at the `Cluster` level, using the `query` method. It takes the statement as a required argument and then allows to provide additional options if needed (in the example above, no options are specified).

Once a result returns you can iterate the returned rows and/or accessing the `QueryMetaData` associated with the query. If something goes wrong during the execution of the query, a derivate of the `CouchbaseException` will be thrown that also provides additional context on the operation:

Expand Down

0 comments on commit 5eed5a8

Please sign in to comment.