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>;
Arguments | Type | Description |
---|---|---|
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);
Edit this page on Github (opens new window)