SDK
SDK Java v3.x
2

This SDK is deprecated. We recommend to use the Kuzzle SDK-JVM.
A migration guide is available here

get #

Gets a document.


Arguments #

public CompletableFuture<ConcurrentHashMap<String, Object>> get(
      final String index,
      final String collection,
      final String id)
throws NotConnectedException, InternalException
ArgumentsTypeDescription
index
String
Index
collection
String
Collection
id
String
Document ID

Return #

A ConcurrentHashMap which has the following properties:

PropertyTypeDescription
_source
ConcurrentHashMap
Document content
_id
String
ID of the document
_version
Integer
Version of the document in the persistent data storage

Usage #

  ConcurrentHashMap<String, Object> result =
  kuzzle.getDocumentController().get("nyc-open-data", "yellow-taxi", "some-id")
  .get();
/*
  {
    _source=
      {
        key1=value1,
        key2=value2,
        _kuzzle_info= { createdAt=1582892127577, author=-1}
      },
    _id=some-id,
    _version=1
  }
*/