get #
Gets a document.
Arguments #
public CompletableFuture<ConcurrentHashMap<String, Object>> get(
final String index,
final String collection,
final String id)
throws NotConnectedException, InternalException
Arguments | Type | Description |
---|---|---|
index | String | Index |
collection | String | Collection |
id | String | Document ID |
Return #
A ConcurrentHashMap
which has the following properties:
Property | Type | Description |
---|---|---|
_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
}
*/
Edit this page on Github(opens new window)