Skip to main content

Module change_event

Module change_event 

Source
Expand description

MongoDB change stream event types.

Represents the structure of change events emitted by MongoDB change streams. Maps MongoDB’s change event document structure to typed Rust structs for safe downstream processing.

§Operation Types

MongoDB change streams emit events for the following operations:

  • insert — new document created; full_document always present
  • update — document modified; update_description contains delta
  • replace — full document replacement
  • delete — document removed; only document_key present
  • drop — collection dropped (lifecycle event)
  • rename — collection renamed (lifecycle event)
  • invalidate — stream invalidated; must restart with startAfter

Structs§

MongoDbChangeEvent
A change event from a MongoDB change stream.
Namespace
The namespace (database + collection) for a change event.
TruncatedArray
Describes a truncated array in an update operation (MongoDB 6.0+).
UpdateDescription
Describes the fields changed during an update operation.

Enums§

OperationType
The type of operation described by a change event.