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 #

createCollection(collection: string, mappings: JSONObject): Promise<void>;

ArgumentsTypeDescription
collection
string
Collection name
mappings
JSONObject
Collection mappings

Return #

The createCollection function returns a promise.

Example #

const mappings = {
  properties: {
    someField: {
      type: 'keyword'
    }
  }
};

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