document.setContent({newContent: 'someValue'}, true);
JSONObject content = new JSONObject().put("content", "some content");

document.setContent(content, true);

use \Kuzzle\Document;

// ...

$documentContent = [
  'field' => 'value'

 * @var $document Document

Replaces the current content with new data.
This is a helper function returning itself, allowing to easily chain calls.

setContent(data, [replace])

dataJSON ObjectNew content
replacebooleantrue: replace the current content with the provided data, false: merge it

Note: by default, the replace argument is set to false

Return value

Returns this Document object to allow chaining.