Subscribe to real-time insert, update, and delete events.
# Watch all changes
sub_id = db.watch()
# Watch a specific collection
sub_id = db.watch(collection="orders")
# Each event contains:
# - operation: "insert" | "update" | "delete"
# - collection name
# - document ID
# - full document (on insert)
# - timestamp
# - resume token (for reconnection)
# Unsubscribe
db.unwatch(sub_id)
Replay buffer holds 4096 events for resumption. If a client disconnects and reconnects, it can resume from the last token.