Skip to main content

Classes

Client

Client for interacting with the TopK API. For available regions see regions Methods Constructor
Parameters

collection()

Get a client for managing data operations on a specific collection such as querying, upserting, and deleting documents. Optionally, pass partition name to scope data operations to that partition. Parameters Returns CollectionClient

collections()

Get a client for managing collections. Returns CollectionsClient

AsyncClient

Async client for interacting with the TopK API. For available regions see regions Methods Constructor
Parameters

collection()

Get an async client for a specific collection. Optionally, pass partition name to scope data operations to that partition. Parameters Returns AsyncCollectionClient

collections()

Get an async client for managing collections. Returns AsyncCollectionsClient

CollectionClient

Synchronous client for collection operations. Methods

get()

Get documents by their IDs. Parameters Returns dict[str, dict[str, Any]]

count()

Get the count of documents in the collection. Parameters Returns int

query()

Execute a query against the collection. Parameters Returns list[dict[str, Any]]

upsert()

Insert or update documents in the collection. Parameters Returns str

update()

Update documents in the collection. Existing documents will be merged with the provided fields. Missing documents will be ignored. Returns the LSN at which the update was applied. If no updates were applied, this will be empty. Parameters Returns str

delete()

Delete documents by their IDs or using a filter expression. Example: Delete documents by their IDs:
Delete documents by a filter expression:
Parameters Returns str

list_partitions()

List partitions in the collection as an iterator. Parameters Returns PartitionListIterator

delete_partition()

Delete a partition and all documents within it. Parameters Returns None

AsyncCollectionClient

Asynchronous client for collection operations. Methods

get()

Get documents by their IDs asynchronously. Parameters Returns Awaitable[dict[str, dict[str, Any]]]

count()

Get the count of documents in the collection asynchronously. Parameters Returns Awaitable[int]

query()

Execute a query against the collection asynchronously. Parameters Returns Awaitable[list[dict[str, Any]]]

upsert()

Insert or update documents in the collection asynchronously. Parameters Returns Awaitable[str]

update()

Update documents in the collection asynchronously. Existing documents will be merged with the provided fields. Missing documents will be ignored. Returns the LSN at which the update was applied. If no updates were applied, this will be empty. Parameters Returns Awaitable[str]

delete()

Delete documents by their IDs or using a filter expression asynchronously. Example: Delete documents by their IDs:
Delete documents by a filter expression:
Parameters Returns Awaitable[str]

list_partitions()

List partitions in the collection as an async iterator. Parameters Returns AsyncPartitionListIterator

delete_partition()

Delete a partition and all documents within it asynchronously. Parameters Returns Awaitable[None]

Collection

Represents a collection in the TopK system. Properties

Partition

Represents a partition in a collection. Properties

CollectionsClient

Synchronous client for managing collections. Methods

get()

Get information about a specific collection. Parameters Returns Collection

list()

List all collections. Returns list[Collection]

create()

Create a new collection with the specified schema. Parameters Returns Collection

delete()

Delete a collection. Parameters Returns None

AsyncCollectionsClient

Asynchronous client for managing collections. Methods

get()

Get information about a specific collection asynchronously. Parameters Returns Awaitable[Collection]

list()

List all collections asynchronously. Returns Awaitable[list[Collection]]

create()

Create a new collection with the specified schema asynchronously. Parameters Returns Awaitable[Collection]

delete()

Delete a collection asynchronously. Parameters Returns Awaitable[None]

PartitionListIterator

Iterator for synchronous partition list responses.

AsyncPartitionListIterator

Iterator for asynchronous partition list responses.

ConsistencyLevel

Consistency level for read operations. Properties

RetryConfig

Configuration for retry behavior. By default, retries occur in two situations:
  1. When the server requests the client to reduce its request rate, resulting in a SlowDownError.
  2. When using the query(..., lsn=N) to wait for writes to be available.
Properties Methods Constructor
Parameters

BackoffConfig

Configuration for backoff behavior in retries. Properties Methods Constructor
Parameters