SDK
SDK Jvm v1.x
2

mDelete #

Deletes multiple documents.


:::: tabs ::: tab Java

Arguments #

public CompletableFuture<Map<String, ArrayList<Object>>> mDelete(
      String index,
      String collection,
      ArrayList<String> ids)
throws NotConnectedException, InternalException

public CompletableFuture<Map<String, ArrayList<Object>>> mDelete(
      String index,
      String collection,
      ArrayList<String> ids,
      Boolean waitForRefresh)
throws NotConnectedException, InternalException
ArgumentsTypeDescription
index
String
Index name
collection
String
Collection name
idsArrayList<String>Document IDs
waitForRefresh
Boolean
If set to true, Kuzzle will wait for the persistence layer to finish indexing

Return #

A Map<String, ArrayList<Object>> which has a successes and errors ArrayList<Object>: The successes array contains the successfully deleted document IDs.

Each deletion error is an object of the errors array with the following properties:

PropertyTypeDescription
_id
String
Document ID
reason
String
Human readable reason

Usage #

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

::: ::: tab Kotlin

Arguments #

fun mDelete(
      index: String,
      collection: String,
      ids: ArrayList<String>,
      waitForRefresh: Boolean? = null): CompletableFuture<Map<String, ArrayList<Any>>>
ArgumentsTypeDescription
index
String
Index name
collection
String
Collection name
idsArrayList<String>Document IDs
waitForRefresh
Boolean
If set to true, Kuzzle will wait for the persistence layer to finish indexing

Return #

A Map<String, ArrayList<Any>> which has a successes and errors ArrayList<Any>: The successes array contains the successfully deleted document IDs.

Each deletion error is an object of the errors array with the following properties:

PropertyTypeDescription
_id
String
Document ID
reason
String
Human readable reason

Usage #

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

::: ::::