SDK
SDK Java v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

This SDK has been deprecated because of stability issues. It is not advised to use it in a production environment.

get #

Gets a document.

Arguments #

String get(
  String index,
  String collection,
  String id,
  io.kuzzle.sdk.QueryOptions options
)
String get(
  String index,
  String collection,
  String id
)

ArgumentTypeDescription
index
String
Index name
collectionstringCollection name
id
String
Document ID
options
io.kuzzle.sdk.QueryOptions
Query options

options #

Additional query options

OptionType
(default)
Description
queuable
boolean

(true)
If true, queues the request during downtime, until connected to Kuzzle again

Return #

Returns a JSON string containing the document.

Exceptions #

Throws a io.kuzzle.sdk.KuzzleException if there is an error. See how to handle error.

Usage #

String doc = "{\"capacity\": 4}";
try {
  kuzzle.getDocument().create("nyc-open-data", "yellow-taxi", "some-id", doc);
  String response = kuzzle.getDocument().get("nyc-open-data", "yellow-taxi", "some-id");
  /*
  {
    "_index":"nyc-open-data",
    "_type":"yellow-taxi",
    "_id":"some-id",
    "_version":1,
    "found":true,
    "_source":{
      "capacity":4,
      "_kuzzle_info":{
      "author":"-1",
      "createdAt":1538402859880,
      "updatedAt":null,
      "updater":null,
      "active":true,
      "deletedAt":null
      }
    }
  }
  */
  System.out.println("Success");
} catch (KuzzleException e) {
  System.err.println(e.getMessage());
}