Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Database
Created by Guest
Created on May 13, 2022

Get metadata about source client connection that submitted a given change

Currently with change streams it is impossible to know who or what connection initiated the changes. It would be a good feature to have to be able to receive some data about the source client connection that initiated a change. My particular use case is the following: I have an app that connects to Atlas. (source client connection) I can subscribe to change streams and then execute some logic when it applies. That app can scale to multiple instances. Each instance subscribes to the change streams. But I only want each instance to execute the logic that applies to only events that they have initiated through their own connection. Right now it seems impossible and the only way to do so would be to generate a unique App ID for each instance and log it in a separate collection for each change and subscribe to that. Although this would work, it would be simpler to have this feature built-in without the need for a separate collection. Maybe this could be good for other use cases. Another use case that I can think of, is the following: If a change is done in a collection that is not made by the source client connection, then apply some logic. For example: my app instance would execute some logic when data was manipulated outside my app, either manually or by third parties. Hope I am being clear, thanks!
  • Attach files