weaviate-client
    Preparing search index...

    Interface Collection<T, N, V>

    interface Collection<T = undefined, N = string, V = undefined> {
        aggregate: Aggregate<T, V>;
        backup: BackupCollection;
        config: Config<T>;
        data: Data<T>;
        exists: () => Promise<boolean>;
        filter: Filter<T extends undefined ? any : T>;
        generate: Generate<T, V>;
        iterator: <I extends IncludeVector<V>, RV>(
            opts?: IteratorOptions<T, I>,
        ) => Iterator<T, RV>;
        length: () => Promise<number>;
        metrics: Metrics<T>;
        multiTargetVector: MultiTargetVector<V>;
        name: N;
        query: Query<T, V>;
        sort: Sort<T>;
        tenants: Tenants;
        withConsistency: (
            consistencyLevel: ConsistencyLevel,
        ) => Collection<T, N, V>;
        withTenant: <TT extends TenantBase>(
            tenant: string | TT,
        ) => Collection<T, N, V>;
    }

    Type Parameters

    • T = undefined
    • N = string
    • V = undefined
    Index

    Properties

    aggregate: Aggregate<T, V>

    This namespace includes all the querying methods available to you when using Weaviate's standard aggregation capabilities.

    This namespace includes all the backup methods available to you when backing up a collection in Weaviate.

    config: Config<T>

    This namespace includes all the CRUD methods available to you when modifying the configuration of the collection in Weaviate.

    data: Data<T>

    This namespace includes all the CUD methods available to you when modifying the data of the collection in Weaviate.

    exists: () => Promise<boolean>

    Use this method to check if the collection exists in Weaviate.

    Type Declaration

      • (): Promise<boolean>
      • Returns Promise<boolean>

        A promise that resolves to true if the collection exists, and false otherwise.

    filter: Filter<T extends undefined ? any : T>

    This namespace includes the methods by which you can create the FilterValue<V> values for use when filtering queries over your collection.

    generate: Generate<T, V>

    This namespace includes all the querying methods available to you when using Weaviate's generative capabilities.

    iterator: <I extends IncludeVector<V>, RV>(
        opts?: IteratorOptions<T, I>,
    ) => Iterator<T, RV>

    Use this method to return an iterator over the objects in the collection.

    This iterator keeps a record of the last object that it returned to be used in each subsequent call to Weaviate. Once the collection is exhausted, the iterator exits.

    Type Declaration

      • <I extends IncludeVector<V>, RV>(opts?: IteratorOptions<T, I>): Iterator<T, RV>
      • Type Parameters

        • I extends IncludeVector<V>

          The vector(s) to include in the response. If using named vectors, pass an array of strings to include only specific vectors.

        • RV

          The vectors(s) to be returned in the response depending on the input in opts.includeVector.

        Parameters

        • Optionalopts: IteratorOptions<T, I>

          The options to use when fetching objects from Weaviate.

        Returns Iterator<T, RV>

        An iterator over the objects in the collection as an async generator.

    If return_properties is not provided, all the properties of each object will be requested from Weaviate except for its vector as this is an expensive operation. Specify include_vector to request the vectors back as well. In addition, if return_references=None then none of the references are returned. Use wvc.QueryReference to specify which references to return.

    length: () => Promise<number>

    Use this method to return the total number of objects in the collection.

    This is a short-hand for calling collection.aggregate.overAll().then(({ totalCount }) => totalCount).

    metrics: Metrics<T>

    This namespace includes the methods by which you can create the MetricsX values for use when aggregating over your collection.

    multiTargetVector: MultiTargetVector<V>

    This namespaces includes the methods by which you cna create the MultiTargetVectorJoin values for use when performing multi-target vector searches over your collection.

    name: N

    The name of the collection.

    query: Query<T, V>

    This namespace includes all the querying methods available to you when using Weaviate's standard query capabilities.

    sort: Sort<T>

    This namespaces includes the methods by which you can create the Sorting<T> values for use when sorting queries over your collection.

    tenants: Tenants

    This namespace includes all the CRUD methods available to you when modifying the tenants of a multi-tenancy-enabled collection in Weaviate.

    withConsistency: (consistencyLevel: ConsistencyLevel) => Collection<T, N, V>

    Use this method to return a collection object specific to a single consistency level.

    If replication is not configured for this collection then Weaviate will throw an error.

    This method does not send a request to Weaviate. It only returns a new collection object that is specific to the consistency level you specify.

    Type Declaration

    withTenant: <TT extends TenantBase>(tenant: string | TT) => Collection<T, N, V>

    Use this method to return a collection object specific to a single tenant.

    If multi-tenancy is not configured for this collection then Weaviate will throw an error.

    This method does not send a request to Weaviate. It only returns a new collection object that is specific to the tenant you specify.

    Type Declaration

      • <TT extends TenantBase>(tenant: string | TT): Collection<T, N, V>
      • Type Parameters

        Parameters

        • tenant: string | TT

          The tenant name or tenant object to use.

        Returns Collection<T, N, V>

        A new collection object specific to the tenant you specified.