SDK
SDK Javascript v5.x
1

collectionMapping #

Creates a new CollectionMapping object, using its constructor.


collectionMapping([mapping]) #

Arguments Type Description
mapping JSON Object Optional mapping

Return Value #

Returns the newly created CollectionMapping object.

Usage #

Copied to clipboard!
let dataMapping = kuzzle
  .collection('collection', 'index')
  .collectionMapping({someField: {type: 'string', index: 'analyzed'}})
  .apply(function (error, result) {
    // called once the mapping action has been completed
  });