Skip to main content

Operations

This section covers operations on collections, databases, and clients. Most reads and writes use a collection; change streams can watch a collection, a database, or the deployment through a client, and client-level bulk writes can span collections and databases. Results are returned in the effect type F[_] (typically IO for Cats Effect or Task for ZIO), or consumed as streams where supported.

  • Indexes — Create and manage indexes for efficient querying
  • Find — Query documents with filters, sorting, pagination, and projections
  • Update — Modify existing documents with a rich set of update operators
  • Distinct — Retrieve unique field values across a collection
  • Aggregate — Build multi-stage aggregation pipelines for complex data transformations
  • Watch — Subscribe to real-time change streams
  • Transactions — Run multiple operations atomically with ACID guarantees
  • Bulk Writes — Execute mixed batches of inserts, updates, and deletes efficiently