SDK
SDK PHP v3.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.

delete #

Deletes this document in Kuzzle.


delete([options], [callback]) #

ArgumentsTypeDescription
optionsJSON ObjectOptional parameters
callbackfunctionOptional callback

Options #

OptionTypeDescriptionDefault
volatileJSON ObjectAdditional information passed to notifications to other usersnull
queuablebooleanMake this request queuable or nottrue
refreshstringIf set to wait_for, Kuzzle will wait for the persistence layer to finish indexing (available with Elasticsearch 5.x and above)undefined

Callback Response #

Returns a string containing the ID of the deleted document.

Usage #

<?php
use \Kuzzle\Document;
// ...
/**
  * @var $document Document
  */
try {
  $result = $document->delete();
} catch (ErrorException $e) {
}