weaviate-client
    Preparing search index...

    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 {
        activate: (
            tenants: string | TenantBase | (string | TenantBase)[],
        ) => Promise<Tenant[]>;
        create: (
            tenants: TenantCreate | TenantBC | (TenantCreate | TenantBC)[],
        ) => Promise<Tenant[]>;
        deactivate: (
            tenants: string | TenantBase | (string | TenantBase)[],
        ) => Promise<Tenant[]>;
        get: () => Promise<Record<string, Tenant>>;
        getByName: <T extends TenantBase>(
            name: string | T,
        ) => Promise<Tenant | null>;
        getByNames: <T extends TenantBase>(
            names: (string | T)[],
        ) => Promise<Record<string, Tenant>>;
        offload: (
            tenants: string | TenantBase | (string | TenantBase)[],
        ) => Promise<Tenant[]>;
        remove: <T extends TenantBase>(
            tenants: string | T | (string | T)[],
        ) => Promise<void>;
        update: (
            tenants: TenantUpdate | TenantBC | (TenantUpdate | TenantBC)[],
        ) => Promise<Tenant[]>;
    }
    Index

    Properties

    activate: (
        tenants: string | TenantBase | (string | TenantBase)[],
    ) => Promise<Tenant[]>

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

    Type Declaration

    create: (
        tenants: TenantCreate | TenantBC | (TenantCreate | TenantBC)[],
    ) => 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

    deactivate: (
        tenants: string | TenantBase | (string | TenantBase)[],
    ) => Promise<Tenant[]>

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

    Type Declaration

    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>>

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

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

    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 extends TenantBase>(name: string | T): Promise<Tenant | null>
      • Type Parameters

        Parameters

        • name: string | T

          The name of the tenant to retrieve.

        Returns Promise<Tenant | null>

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

    getByNames: <T extends TenantBase>(
        names: (string | T)[],
    ) => 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 extends TenantBase>(names: (string | T)[]): Promise<Record<string, Tenant>>
      • Type Parameters

        Parameters

        • names: (string | T)[]

          The tenants to retrieve.

        Returns Promise<Record<string, Tenant>>

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

    offload: (
        tenants: string | TenantBase | (string | TenantBase)[],
    ) => Promise<Tenant[]>

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

    Type Declaration

    remove: <T extends TenantBase>(
        tenants: string | T | (string | T)[],
    ) => 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 extends TenantBase>(tenants: string | T | (string | T)[]): Promise<void>
      • Type Parameters

        Parameters

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

          The tenant or tenants to remove.

        Returns Promise<void>

        An empty promise.

    update: (
        tenants: TenantUpdate | TenantBC | (TenantUpdate | TenantBC)[],
    ) => 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