SDK
SDK Java v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

This SDK has been deprecated because of stability issues. It is not advised to use it in a production environment.

delete #

Deletes a document.

The optional parameter refresh can be used with the value wait_for in order to wait for the document to be indexed (and to no longer be available in search).

Arguments #

String delete(
  String index,
  String collection,
  String id,
  io.kuzzle.sdk.QueryOptions options
)
String delete(
  String index,
  String collection,
  String id
)

ArgumentTypeDescription
index
String
Index name
collection
String
Collection name
id
String
Document ID
options
io.kuzzle.sdk.QueryOptions
Query options

options #

Additional query options

OptionType
(default)
Description
queuable
boolean

(true)
If true, queues the request during downtime, until connected to Kuzzle again
refresh
String

("")
If set to wait_for, waits for the change to be reflected for search (up to 1s)

Return #

Returns the id of the deleted document.

Exceptions #

Throws a io.kuzzle.sdk.KuzzleException if there is an error. See how to handle error.

Usage #

try {
  String id = kuzzle.getDocument().delete("nyc-open-data", "yellow-taxi", "some-id");
  if (id.equals("some-id")) {
    System.out.println("Success");
  }
} catch (KuzzleException e) {
  System.err.println(e.getMessage());
}