Skip to main content

create

create(modelName, client): Promise<Model>

Creates a new model and adds it to the CausaDB system. Retrieves any existing configuration from the server and then updates the server with any new configurations.

Parameters

NameTypeDescription
modelNamestringThe name of the model to create.
clientCausaDBA CausaDB client.

Returns

Promise<Model>

The current state of the model.

Throws

If the request fails or the model does not exist.

Example

const client = new CausaDB();
await client.setToken('test-token-secret');
const model = await Model.create('test-model', client);