Skip to content

Release v22.136.0

Choose a tag to compare

@github-actions github-actions released this 21 Oct 15:38
1d4e022

Observing MongoDB collections no longer opens a change stream, and holds a pooled connection, for every subscription. All observations of a database now share one change stream.

Changed

  • Observe, ObserveSingle and ObserveById on IMongoCollection now use the shared per-database change stream owned by IMongoDBWatcher, with no configuration. A page with 30 observable queries holds one change stream instead of 30.
  • Observations attach to the shared stream before their initial query, so a change made while it runs is applied afterwards instead of lost.
  • Inserts into an observed collection are now checked against the observed filter with one lookup by id, as updates already were, because the shared stream cannot be narrowed by it. Observations that take every document skip the lookup.
  • IMongoDBWatcher has a new GetChanges(string databaseName) member that exposes the shared stream. Custom implementations of the interface must add it.
  • A failed shared stream reconnects with backoff and resumes from its last change, so a transient connection failure no longer ends collection observations.