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.

document #

Creates a new Document object, using its constructor.


document([id], [content]) #

Arguments Type Description
id string Optional document unique ID
content JSON object Optional document content

Return Value #

Returns the newly created Document object.

Usage #

Copied to clipboard!
let document = kuzzle
  .collection('collection', 'index')
  .document('id', {some: 'content'})
  .save();