A NoSQL document collection with Task/Stream semantics.
Provides CRUD operations (get, put, delete) that return Task
for error handling, and find() which returns a Source for streaming
query results with concurrent processing support.
connect<TDoc,TQuery,TKey,>(connector: DocumentConnector<TDoc, TQuery, TKey>,name: string,): Task<Collection<TDoc, TQuery, TKey>, CollectionConnectionFailed>
Connects to a collection via a connector and returns a Collection.
create<TDoc,TQuery,TKey,>(adapter: DocumentAdapter<TDoc, TQuery, TKey>,name: string,): Collection<TDoc, TQuery, TKey>
Creates a Collection from an already-connected adapter.
delete(key: TKey): Task<void, CollectionDeleteFailed>
Deletes a document by its key.
find(query: TQuery): Source<TDoc, CollectionFindFailed>
Queries documents and returns a stream of results.
get(key: TKey): Task<TDoc | null, CollectionGetFailed>
Fetches a single document by its key.
put(): Task<void, CollectionPutFailed>
Upserts a document.
putMany(entries: { key: TKey; doc: TDoc; }[]): Task<void, CollectionPutManyFailed>
Batch writes multiple documents.