Core
Framework v2.x
2

createCollection #

Creates a collection in the plugin storage.

Can be called any number of times as long as the mapping is not modified.

Arguments #

Copied to clipboard!
createCollection(collection: string, mappings: JSONObject): Promise<void>;

Arguments Type Description
collection
string
Collection name
mappings
JSONObject
Collection mappings

Return #

The createCollection function returns a promise.

Example #

Copied to clipboard!
const mappings = {
  properties: {
    someField: {
      type: 'keyword'
    }
  }
};

await context.accessors.storage.createCollection('collection1', mappings);