SDK
SDK Jvm v1.x
2

mGet #

Gets multiple documents.


:::: tabs ::: tab Java

Arguments #

Copied to clipboard!
public CompletableFuture<Map<String, ArrayList<Object>>> mGet(
      String index,
      String collection,
      ArrayList<String> ids)
throws NotConnectedException, InternalException

Arguments Type Description
index
String
Index name
collection
String
Collection name
ids ArrayList<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:

Property Type Description
_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 #

Copied to clipboard!
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 #

Copied to clipboard!
fun mGet(
      index: String,
      collection: String,
      ids: ArrayList<String>): CompletableFuture<Map<String, ArrayList<Any>>>
Arguments Type Description
index
String
Index name
collection
String
Collection name
ids ArrayList<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:

Property Type Description
_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 #

Copied to clipboard!
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()

::: ::::