SDK
SDK Javascript v5.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.

mDeleteDocument #

Delete multiple Documents according to the input IDs.


mDeleteDocument(documentIds, [options], callback) #

ArgumentsTypeDescription
documentIdsString[]Array of IDs of documents to delete
optionsJSON ObjectOptional parameters
callbackfunctionCallback handling the response

Options #

OptionTypeDescriptionDefault
queuablebooleanMake this request queuable or nottrue

Callback Response #

Returns a JSON object containing the raw Kuzzle response. Can return a 206 partial error in cases where some documents could not be deleted.

Usage #

// Using callbacks (NodeJS or Web Browser)
kuzzle
  .collection('collection', 'index')
  .mDeleteDocument(['doc1', 'doc2'], function (error, result) {
    // callback called once the mDelete operation has completed
    // => the result is a JSON object containing the raw Kuzzle response
  });
// Using promises (NodeJS only)
kuzzle
  .collection('collection', 'index')
  .mDeleteDocument()
  .then(result => {
    // promise resolved once the mDelete operation has completed
    // => the result is a JSON object containing the raw Kuzzle response
  });

Callback response:

["doc1", "doc2"]