Core
Framework v2.x
2

bootstrap #

Initializes the plugin private storage.

Can be called as much as needed as long as identical mappings are provided.

In a cluster, the nodes create the collections one at a time, under a cluster-wide lock, and each node waits for that lock with no time limit.

Available since 2.60.0
Before 2.60.0, a single node created them while the others waited, then only loaded them into their cache.

The lock is extended while the collections are created. If it is lost, the returned promise rejects with MutexLockLostError.

Arguments #

bootstrap(collections: JSONObject) => Promise<void>;

ArgumentsTypeDescription
collections
JSONObject
List of collections to create, with their corresponding mappings

Return #

The bootstrap function returns a promise, resolving once the storage is initialized.

Example #

const mappings = {
  collection1: {
    properties: {
      someField: {
        type: 'keyword'
      }
    }
  },
  collection2: {
    properties: {
      // ...
    }
  }
};

await context.accessors.storage.bootstrap(mappings);