Mongo.watch_db

You're seeing just the function watch_db, go back to Mongo module for more information.
Link to this function

watch_db(topology_pid, pipeline, on_resume_token \\ nil, opts \\ [])

View Source

Specs

watch_db(
  GenServer.server(),
  [BSON.document()],
  (... -> any()) | nil,
  Keyword.t()
) :: cursor()

Creates a change stream cursor all collections of the database.

on_resume_token is function that takes the new resume token, if it changed.

Options

  • :full_document -
  • :max_time - Specifies a time limit in milliseconds. This option is used on getMore commands
  • :batch_size - Specifies the number of maximum number of documents to return (default: 1)
  • :resume_after - Specifies the logical starting point for the new change stream.
  • :start_at_operation_time - The change stream will only provide changes that occurred at or after the specified timestamp (since 4.0)
  • :start_after - Similar to resumeAfter, this option takes a resume token and starts a new change stream returning the first notification after the token. This will allow users to watch collections that have been dropped and recreated or newly renamed collections without missing any notifications. (since 4.0.7)