Interface Tenants

Represents all the CRUD methods available on a collection's multi-tenancy specification within Weaviate.

The collection must have been created with multi-tenancy enabled in order to use any of these methods. This class should not be instantiated directly, but is available as a property of the Collection class under the collection.tenants class attribute.

Starting from Weaviate v1.26, the naming convention around tenant activitiy statuses is changing. The changing nomenclature is as follows:

  • HOT is now ACTIVE, which means loaded fully into memory and ready for use.
  • COLD is now INACTIVE, which means not loaded into memory with files stored on disk.

With this change, new statuses are being added. One is mutable and the other two are immutable. They are:

  • OFFLOADED, which means the tenant is not loaded into memory with files stored on the cloud.
  • OFFLOADING, which means the tenant is transitioning to the OFFLOADED status.
  • ONLOADING, which means the tenant is transitioning from the OFFLOADED status.
interface Tenants {
    create: ((tenants) => Promise<Tenant[]>);
    get: (() => Promise<Record<string, Tenant>>);
    getByName: (<T>(name) => Promise<null | Tenant>);
    getByNames: (<T>(names) => Promise<Record<string, Tenant>>);
    remove: (<T>(tenants) => Promise<void>);
    update: ((tenants) => Promise<Tenant[]>);
}

Properties

create: ((tenants) => Promise<Tenant[]>)

Create the specified tenants for a collection in Weaviate. The collection must have been created with multi-tenancy enabled.

For details on the new activity statuses, see the docstring for the Tenants interface type.

Type declaration

Returns

The created tenant(s) as a list of Tenant.

get: (() => Promise<Record<string, Tenant>>)

Return all tenants currently associated with a collection in Weaviate. The collection must have been created with multi-tenancy enabled.

For details on the new activity statuses, see the docstring for the Tenants interface type.

Type declaration

    • (): Promise<Record<string, Tenant>>
    • Returns Promise<Record<string, Tenant>>

Returns

A list of tenants as an object of Tenant types, where the key is the tenant name.

getByName: (<T>(name) => Promise<null | Tenant>)

Return the specified tenant from a collection in Weaviate. The collection must have been created with multi-tenancy enabled.

For details on the new activity statuses, see the docstring for the Tenants interface type.

Type declaration

    • <T>(name): Promise<null | Tenant>
    • Type Parameters

      Parameters

      • name: string | T

        The name of the tenant to retrieve.

      Returns Promise<null | Tenant>

Returns

The tenant as a Tenant type, or null if the tenant does not exist.

getByNames: (<T>(names) => Promise<Record<string, Tenant>>)

Return the specified tenants from a collection in Weaviate. The collection must have been created with multi-tenancy enabled.

For details on the new activity statuses, see the docstring for the Tenants interface type.

Type declaration

    • <T>(names): Promise<Record<string, Tenant>>
    • Type Parameters

      Parameters

      • names: (string | T)[]

        The tenants to retrieve.

      Returns Promise<Record<string, Tenant>>

Returns

The list of tenants. If the tenant does not exist, it will not be included in the list.

remove: (<T>(tenants) => Promise<void>)

Remove the specified tenants from a collection in Weaviate. The collection must have been created with multi-tenancy enabled.

For details on the new activity statuses, see the docstring for the Tenants interface type.

Type declaration

    • <T>(tenants): Promise<void>
    • Type Parameters

      Parameters

      • tenants: string | T | (string | T)[]

        The tenant or tenants to remove.

      Returns Promise<void>

Returns

An empty promise.

update: ((tenants) => Promise<Tenant[]>)

Update the specified tenants for a collection in Weaviate. The collection must have been created with multi-tenancy enabled.

For details on the new activity statuses, see the docstring for the Tenants interface type.

Type declaration

Returns

The updated tenant(s) as a list of Tenant.