Interface Config<T>

interface Config<T> {
    addProperty: ((property) => Promise<void>);
    addReference: ((reference) => Promise<void>);
    get: (() => Promise<CollectionConfig>);
    getShards: (() => Promise<Required<{
        name?: string;
        status?: string;
        vectorQueueSize?: number;
    }>[]>);
    update: ((config?) => Promise<void>);
    updateShards: ((status, names?) => Promise<Required<{
        name?: string;
        status?: string;
        vectorQueueSize?: number;
    }>[]>);
}

Type Parameters

  • T

Properties

addProperty: ((property) => Promise<void>)

Add a property to the collection in Weaviate.

Type declaration

    • (property): Promise<void>
    • Parameters

      • property: {
            dataType: "number" | "boolean" | "object" | "uuid" | "text" | "date" | "object[]" | "blob" | "int" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber";
            description?: string;
            indexFilterable?: boolean;
            indexInverted?: boolean;
            indexRangeFilters?: boolean;
            indexSearchable?: boolean;
            name: string;
            nestedProperties?: ({
                dataType: "number" | "boolean" | "object" | "uuid" | "text" | "date" | "object[]" | "blob" | "int" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber";
                description?: string;
                indexFilterable?: boolean;
                indexInverted?: boolean;
                indexSearchable?: boolean;
                name: string;
                nestedProperties?: ({ name: string; dataType: "number" | "boolean" | "object" | "uuid" | "text" | "date" | "object[]" | "blob" | "int" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber"; ... 5 more ...; tokenization?: "word" | ... 3 more ... | undefined; } | ({ ...; } & NestedPrope...;
                tokenization?: "word" | "lowercase" | "whitespace" | "field";
            } | {
                dataType: "number" | "boolean" | "object" | "uuid" | "text" | "date" | "object[]" | "blob" | "int" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber";
                name: string;
                nestedProperties?: ({ name: string; dataType: "number" | "boolean" | "object" | "uuid" | "text" | "date" | "object[]" | "blob" | "int" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber"; ... 5 more ...; tokenization?: "word" | ... 3 more ... | undefined; } | ({ ...; } & NestedPrope...;
            } & NestedPropertyConfigCreateBase)[];
            skipVectorization?: boolean;
            tokenization?: "word" | "lowercase" | "whitespace" | "field" | "trigram" | "gse" | "kagome_kr";
            vectorizePropertyName?: boolean;
        } | {
            dataType: "number" | "boolean" | "object" | "uuid" | "text" | "date" | "object[]" | "blob" | "int" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber";
            name: string;
            nestedProperties?: ({
                dataType: "number" | "boolean" | "object" | "uuid" | "text" | "date" | "object[]" | "blob" | "int" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber";
                description?: string;
                indexFilterable?: boolean;
                indexInverted?: boolean;
                indexSearchable?: boolean;
                name: string;
                nestedProperties?: ({ name: string; dataType: "number" | "boolean" | "object" | "uuid" | "text" | "date" | "object[]" | "blob" | "int" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber"; ... 5 more ...; tokenization?: "word" | ... 3 more ... | undefined; } | ({ ...; } & NestedPrope...;
                tokenization?: "word" | "lowercase" | "whitespace" | "field";
            } | {
                dataType: "number" | "boolean" | "object" | "uuid" | "text" | "date" | "object[]" | "blob" | "int" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber";
                name: string;
                nestedProperties?: ({ name: string; dataType: "number" | "boolean" | "object" | "uuid" | "text" | "date" | "object[]" | "blob" | "int" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber"; ... 5 more ...; tokenization?: "word" | ... 3 more ... | undefined; } | ({ ...; } & NestedPrope...;
            } & NestedPropertyConfigCreateBase)[];
        } & PropertyConfigCreateBase

        The property configuration.

      Returns Promise<void>

Returns

A promise that resolves when the property has been added.

addReference: ((reference) => Promise<void>)

Add a reference to the collection in Weaviate.

Type declaration

Returns

A promise that resolves when the reference has been added.

get: (() => Promise<CollectionConfig>)

Get the configuration for this collection from Weaviate.

Type declaration

Returns

A promise that resolves with the collection configuration.

getShards: (() => Promise<Required<{
    name?: string;
    status?: string;
    vectorQueueSize?: number;
}>[]>)

Get the statuses of the shards of this collection.

If the collection is multi-tenancy and you did not call .with_tenant then you will receive the statuses of all the tenants within the collection. Otherwise, call .with_tenant on the collection first and you will receive only that single shard.

Type declaration

    • (): Promise<Required<{
          name?: string;
          status?: string;
          vectorQueueSize?: number;
      }>[]>
    • Returns Promise<Required<{
          name?: string;
          status?: string;
          vectorQueueSize?: number;
      }>[]>

Returns

A promise that resolves with the shard statuses.

update: ((config?) => Promise<void>)

Update the configuration for this collection in Weaviate.

Use the weaviate.classes.Reconfigure class to generate the necessary configuration objects for this method.

Type declaration

    • (config?): Promise<void>
    • Parameters

      • Optional config: CollectionConfigUpdate

        The configuration to update. Only a subset of the actual collection configuration can be updated.

      Returns Promise<void>

Returns

A promise that resolves when the collection has been updated.

updateShards: ((status, names?) => Promise<Required<{
    name?: string;
    status?: string;
    vectorQueueSize?: number;
}>[]>)

Update the status of one or all shards of this collection.

Type declaration

    • (status, names?): Promise<Required<{
          name?: string;
          status?: string;
          vectorQueueSize?: number;
      }>[]>
    • Parameters

      • status: "READY" | "READONLY"

        The new status of the shard(s).

      • Optional names: string | string[]

        The name(s) of the shard(s) to update. If not provided, all shards will be updated.

      Returns Promise<Required<{
          name?: string;
          status?: string;
          vectorQueueSize?: number;
      }>[]>

Returns

A promise that resolves with the updated shard statuses.