SDK
SDK Jvm v1.x
2

mGet #

Gets multiple documents.


:::: tabs ::: tab Java

Arguments #

public CompletableFuture<Map<String, ArrayList<Object>>> mGet(
      String index,
      String collection,
      ArrayList<String> ids)
throws NotConnectedException, InternalException
ArgumentsTypeDescription
index
String
Index name
collection
String
Collection name
idsArrayList<String>Document IDs

Return #

A Map<String, ArrayList<Object>> which has a successes and errors ArrayList<Object>: Each created document is an object of the successes array with the following properties:

PropertyTypeDescription
_source
Map<String, Object>
Document content
_id
String
Document ID
_version
Integer
Version of the document in the persistent data storage

The errors array contain the IDs of not found documents.

Usage #

final ArrayList<String> ids = new ArrayList<>();
ids.add("some-id");
ids.add("some-id2");
Map<String, ArrayList<Object>> result =
  kuzzle
  .getDocumentController()
  .mGet("nyc-open-data", "yellow-taxi", ids)
  .get();

::: ::: tab Kotlin

Arguments #

fun mGet(
      index: String,
      collection: String,
      ids: ArrayList<String>): CompletableFuture<Map<String, ArrayList<Any>>>
ArgumentsTypeDescription
index
String
Index name
collection
String
Collection name
idsArrayList<String>Document IDs

Return #

A Map<String, ArrayList<Object>> which has a successes and errors ArrayList<Object>: Each created document is an object of the successes array with the following properties:

PropertyTypeDescription
_source
Map<String, Any?>
Document content
_id
String
Document ID
_version
Int
Version of the document in the persistent data storage

The errors array contain the IDs of not found documents.

Usage #

val ids: ArrayList<String> = ArrayList<String>().apply {
  add("some-id")
  add("some-id2")
}
val result: Map<String, ArrayList<Any>> =
  kuzzle
    .documentController
    .mGet("nyc-open-data", "yellow-taxi", ids)
    .get()

::: ::::