Interface Config<T>

interface Config<T> {
    addProperty: ((property) => Promise<void>);
    addReference: ((reference) => Promise<void>);
    addVector: ((vectors) => 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: ({ name: string; description?: string | undefined; indexInverted?: boolean | undefined; indexFilterable?: boolean | undefined; indexRangeFilters?: boolean | undefined; indexSearchable?: boolean | undefined; tokenization?: "word" | ... 8 more ... | undefined; skipVectorization?: boolean | undefined; vectorizePropertyN...) | {
            dataType: "number" | "boolean" | "object" | "int" | "text" | "date" | "uuid" | "object[]" | "blob" | "text[]" | "uuid[]" | "number[]" | "int[]" | "boolean[]" | "date[]" | "geoCoordinates" | "phoneNumber";
            name: string;
            nestedProperties?: (({ name: string; description?: string | undefined; indexInverted?: boolean | undefined; indexFilterable?: boolean | undefined; indexSearchable?: boolean | undefined; tokenization?: "word" | ... 8 more ... | undefined; } & NestedDataTypeConfig<...>) | ({ ...; } & 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.

addVector: ((vectors) => Promise<void>)

Add one or more named vectors to the collection in Weaviate. Named vectors can be added to collections with existing named vectors only.

Existing named vectors are immutable in Weaviate. The client will not include any of those in the request.

Type declaration

    • (vectors): Promise<void>
    • Parameters

      Returns Promise<void>

Returns

A promise that resolves when the named vector has been created.

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

        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.