exists

// Using callbacks (NodeJS or Web Browser)
document.exists(function (error, exists) {
  // called once the exists check has been completed
});
document.exists(new ResponseListener<Boolean>() {
    @Override
    public void onSuccess(Boolean exists) {
      // called once the exists check has been completed
    }

    @Override
    public void onError(JSONObject error) {
      // Handle error
    }
});
<?php

use \Kuzzle\Document;

// ...

/**
 * @var $document Document
 */

try {
  $exists = $document->exists();
} catch (ErrorException $e) {

}

Checks if the document exists in Kuzzle.


exists([options], callback)

ArgumentsTypeDescription
optionsJSON ObjectOptional parameters
callbackfunctionCallback handling the response

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queueabletrue

Callback response

Resolves to a boolean indicating whether or not the document exists in Kuzzle