Module mongodb

Source
Expand description

MongoDB Document Listener

This module provides MongoDocumentListener, which listens for changes in specified MongoDB collections. It utilizes MongoDB’s Change Streams to capture and relay events asynchronously.

§Features

  • Monitors specified collections for INSERT, UPDATE, and DELETE operations.
  • Uses MongoDB’s Change Streams for real-time event detection.
  • Filters events based on operation types (INSERT, UPDATE, DELETE).
  • Sends notifications through async channels.
  • Provides a structured API to start and stop listeners.

§Dependencies

  • mongodb for database interaction
  • tokio for async execution
  • serde and serde_json for JSON serialization
  • tracing for logging

Structs§

MongoDocumentListener
MongoNotify