Interface Collections

interface Collections {
    create<TProperties, TName>(config): Promise<Collection<TProperties, TName>>;
    createFromSchema(config): Promise<Collection<Properties, string>>;
    delete(collection): Promise<void>;
    deleteAll(): Promise<void[]>;
    exists(name): Promise<boolean>;
    export(name): Promise<CollectionConfig>;
    get<TProperties, TName>(name): Collection<TProperties, TName>;
    listAll(): Promise<CollectionConfig[]>;
}

Methods

  • Parameters

    • config: {
          class?: string;
          description?: string;
          invertedIndexConfig?: {
              bm25?: {
                  b?: number;
                  k1?: number;
              };
              cleanupIntervalSeconds?: number;
              indexNullState?: boolean;
              indexPropertyLength?: boolean;
              indexTimestamps?: boolean;
              stopwords?: {
                  additions?: string[];
                  preset?: string;
                  removals?: string[];
              };
          };
          moduleConfig?: {
              [key: string]: unknown;
          };
          multiTenancyConfig?: {
              autoTenantActivation?: boolean;
              autoTenantCreation?: boolean;
              enabled?: boolean;
          };
          properties?: {
              dataType?: string[];
              description?: string;
              indexFilterable?: boolean;
              indexInverted?: boolean;
              indexRangeFilters?: boolean;
              indexSearchable?: boolean;
              moduleConfig?: {
                  [key: string]: unknown;
              };
              name?: string;
              nestedProperties?: {
                  dataType?: string[];
                  description?: string;
                  indexFilterable?: boolean;
                  indexRangeFilters?: boolean;
                  indexSearchable?: boolean;
                  name?: string;
                  nestedProperties?: { dataType?: string[] | undefined; description?: string | undefined; name?: string | undefined; indexFilterable?: boolean | undefined; indexSearchable?: boolean | undefined; indexRangeFilters?: boolean | undefined; tokenization?: "word" | ... 3 more ... | undefined; nestedProperties?: ...[] | undefined; }[] | undefi...;
                  tokenization?: "word" | "lowercase" | "whitespace" | "field";
              }[];
              tokenization?: "word" | "lowercase" | "whitespace" | "field" | "trigram" | "gse" | "kagome_kr";
          }[];
          replicationConfig?: {
              asyncEnabled?: boolean;
              factor?: number;
          };
          shardingConfig?: {
              [key: string]: unknown;
          };
          vectorConfig?: {
              [key: string]: definitions["VectorConfig"];
          };
          vectorIndexConfig?: {
              [key: string]: unknown;
          };
          vectorIndexType?: string;
          vectorizer?: string;
      }
      • Optional class?: string

        Description

        Name of the class as URI relative to the schema URL.

      • Optional description?: string

        Description

        Description of the class.

      • Optional invertedIndexConfig?: {
            bm25?: {
                b?: number;
                k1?: number;
            };
            cleanupIntervalSeconds?: number;
            indexNullState?: boolean;
            indexPropertyLength?: boolean;
            indexTimestamps?: boolean;
            stopwords?: {
                additions?: string[];
                preset?: string;
                removals?: string[];
            };
        }
        • Optional bm25?: {
              b?: number;
              k1?: number;
          }
          • Optional b?: number

            Format: float

            Description

            calibrates term-weight scaling based on the document length

          • Optional k1?: number

            Format: float

            Description

            calibrates term-weight scaling based on the term frequency within a document

        • Optional cleanupIntervalSeconds?: number

          Format: int

          Description

          Asynchronous index clean up happens every n seconds

        • Optional indexNullState?: boolean

          Description

          Index each object with the null state

        • Optional indexPropertyLength?: boolean

          Description

          Index length of properties

        • Optional indexTimestamps?: boolean

          Description

          Index each object by its internal timestamps

        • Optional stopwords?: {
              additions?: string[];
              preset?: string;
              removals?: string[];
          }
          • Optional additions?: string[]

            Description

            stopwords to be considered additionally

          • Optional preset?: string

            Description

            pre-existing list of common words by language

          • Optional removals?: string[]

            Description

            stopwords to be removed from consideration

      • Optional moduleConfig?: {
            [key: string]: unknown;
        }

        Description

        Configuration specific to modules this Weaviate instance has installed

        • [key: string]: unknown
      • Optional multiTenancyConfig?: {
            autoTenantActivation?: boolean;
            autoTenantCreation?: boolean;
            enabled?: boolean;
        }
        • Optional autoTenantActivation?: boolean

          Description

          Existing tenants should (not) be turned HOT implicitly when they are accessed and in another activity status

        • Optional autoTenantCreation?: boolean

          Description

          Nonexistent tenants should (not) be created implicitly

        • Optional enabled?: boolean

          Description

          Whether or not multi-tenancy is enabled for this class

      • Optional properties?: {
            dataType?: string[];
            description?: string;
            indexFilterable?: boolean;
            indexInverted?: boolean;
            indexRangeFilters?: boolean;
            indexSearchable?: boolean;
            moduleConfig?: {
                [key: string]: unknown;
            };
            name?: string;
            nestedProperties?: {
                dataType?: string[];
                description?: string;
                indexFilterable?: boolean;
                indexRangeFilters?: boolean;
                indexSearchable?: boolean;
                name?: string;
                nestedProperties?: { dataType?: string[] | undefined; description?: string | undefined; name?: string | undefined; indexFilterable?: boolean | undefined; indexSearchable?: boolean | undefined; indexRangeFilters?: boolean | undefined; tokenization?: "word" | ... 3 more ... | undefined; nestedProperties?: ...[] | undefined; }[] | undefi...;
                tokenization?: "word" | "lowercase" | "whitespace" | "field";
            }[];
            tokenization?: "word" | "lowercase" | "whitespace" | "field" | "trigram" | "gse" | "kagome_kr";
        }[]

        Description

        The properties of the class.

      • Optional replicationConfig?: {
            asyncEnabled?: boolean;
            factor?: number;
        }
        • Optional asyncEnabled?: boolean

          Description

          Enable asynchronous replication

        • Optional factor?: number

          Description

          Number of times a class is replicated

      • Optional shardingConfig?: {
            [key: string]: unknown;
        }

        Description

        Manage how the index should be sharded and distributed in the cluster

        • [key: string]: unknown
      • Optional vectorConfig?: {
            [key: string]: definitions["VectorConfig"];
        }
        • [key: string]: definitions["VectorConfig"]
      • Optional vectorIndexConfig?: {
            [key: string]: unknown;
        }

        Description

        Vector-index config, that is specific to the type of index selected in vectorIndexType

        • [key: string]: unknown
      • Optional vectorIndexType?: string

        Description

        Name of the vector index to use, eg. (HNSW)

      • Optional vectorizer?: string

        Description

        Specify how the vectors for this class should be determined. The options are either 'none' - this means you have to import a vector with each object yourself - or the name of a module that provides vectorization capabilities, such as 'text2vec-contextionary'. If left empty, it will use the globally configured default which can itself either be 'none' or a specific module.

    Returns Promise<Collection<Properties, string>>