<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:40:14 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-79163] Add Option to Bypass Change Streams for Specific Operations</title>
                <link>https://jira.mongodb.org/browse/SERVER-79163</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Dear MongoDB/Mongoose maintainers,&lt;/p&gt;

&lt;p&gt;I am writing to propose a new feature that I believe would enhance the utility and flexibility of MongoDB&apos;s Change Streams.&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;Problem&quot;&gt;&lt;/a&gt;Problem&lt;/h3&gt;

&lt;p&gt;In scenarios where MongoDB Change Streams are being used to sync two databases, a potential issue of recursive loops arises. For instance, consider a system that has two databases (DB1 and DB2) being synced. An operation (like an &lt;tt&gt;insert&lt;/tt&gt; or &lt;tt&gt;update&lt;/tt&gt;) on DB1 triggers a change event that is captured by the Change Stream. This event leads to a corresponding operation on DB2. However, this operation on DB2, in turn, triggers another change event on DB1, thereby potentially causing an infinite loop of updates.&lt;/p&gt;

&lt;p&gt;At present, to circumvent this issue, developers need to devise multiple guards or checks to prevent these infinite loops. However, this process can be complex and error-prone and can clutter the code with numerous conditionals.&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;ProposedSolution&quot;&gt;&lt;/a&gt;Proposed Solution&lt;/h3&gt;

&lt;p&gt;I propose the addition of an option in MongoDB/Mongoose operations (like &lt;tt&gt;insert&lt;/tt&gt;, &lt;tt&gt;update&lt;/tt&gt;, etc.) that allows these operations to be &apos;invisible&apos; to Change Streams. This would provide a straightforward way to break the loop in database syncing scenarios by ensuring that an operation meant as a response to a Change Stream does not itself produce a new change event.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;For instance, the API for an &lt;tt&gt;insert&lt;/tt&gt; the operation could look like this:&lt;br/&gt;
{{db.collection.insertOne(document, &lt;/p&gt;
{ bypassChangeStream: true }
&lt;p&gt;);}}&lt;br/&gt;
&#160;&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;OtherUseCases&quot;&gt;&lt;/a&gt;Other Use Cases&lt;/h3&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;b&gt;Bulk operations&lt;/b&gt;: During bulk data operations, developers might want to prevent each operation from triggering a change event to avoid flooding the change stream.&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;&lt;b&gt;Temporary or intermediate updates&lt;/b&gt;: In some workflows, there might be temporary updates to the database that need not be propagated through the Change Stream.&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;&lt;b&gt;Testing scenarios&lt;/b&gt;: This could be useful in test suites where certain operations are performed purely for testing and do not need to trigger a Change Stream event.&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;&lt;a name=&quot;NextSteps&quot;&gt;&lt;/a&gt;Next Steps&lt;/h3&gt;

&lt;p&gt;I appreciate the potential implications of this change, and I understand that it might require substantial modifications to the MongoDB and Mongoose codebase. I am eager to discuss this proposal further and, if the community finds this feature beneficial, I am willing to contribute to its implementation.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2397224">SERVER-79163</key>
            <summary>Add Option to Bypass Change Streams for Specific Operations</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="1" iconUrl="https://jira.mongodb.org/images/icons/statuses/open.png" description="">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="samuelvonfruhauf@gmail.com">Samuel Augusto Vian Von Fruhauf</reporter>
                        <labels>
                            <label>external-user</label>
                    </labels>
                <created>Thu, 20 Jul 2023 17:45:27 +0000</created>
                <updated>Thu, 20 Jul 2023 18:40:41 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="5580800" author="dbeng-pm-bot" created="Thu, 20 Jul 2023 17:45:30 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=samuelvonfruhauf%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;samuelvonfruhauf@gmail.com&quot;&gt;samuelvonfruhauf@gmail.com&lt;/a&gt;, thank you for submitting this ticket! The team is going to investigate and reply back with more info after the investigation is completed. &lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 20 Jul 2023 17:45:30 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        28 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>alex.bevilacqua@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            28 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>dbeng-pm-bot</customfieldvalue>
            <customfieldvalue>samuelvonfruhauf@gmail.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2iu7z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i20ywg:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2igdb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>