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