<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:37:47 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-78231] Change Stream is not working with on-demand materialized views</title>
                <link>https://jira.mongodb.org/browse/SERVER-78231</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The same code works with a regular Mongo collection but doesn&apos;t catch any events happening to the on-demand materialized view.&lt;/p&gt;

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

&lt;p&gt;I found the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/jstests/change_streams/ban_from_views.js#L34&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;test&lt;/a&gt; which checks that the Change Stream is not supported for normal views.&lt;/p&gt;

&lt;p&gt;However, I didn&apos;t find any limitations/restrictions to using &lt;a href=&quot;https://www.mongodb.com/docs/manual/changeStreams/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Change Streams&lt;/a&gt; with &lt;a href=&quot;https://www.mongodb.com/docs/manual/core/materialized-views/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;on-demand materialized views.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2372483">SERVER-78231</key>
            <summary>Change Stream is not working with on-demand materialized views</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="12452" iconUrl="https://jira.mongodb.org/images/icons/statuses/generic.png" description="">Needs Scheduling</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="kateryna.kamenieva@mongodb.com">Katya Kamenieva</assignee>
                                    <reporter username="k.chaus@efg.gg">Kos Chaus</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Jun 2023 13:54:20 +0000</created>
                <updated>Fri, 1 Sep 2023 15:15:31 +0000</updated>
                                            <version>5.0.7</version>
                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5675003" author="kateryna.kamenieva" created="Fri, 1 Sep 2023 15:15:31 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=k.chaus%40efg.gg&quot; class=&quot;user-hover&quot; rel=&quot;k.chaus@efg.gg&quot;&gt;k.chaus@efg.gg&lt;/a&gt; could you provide more details for steps 2,3,5. &lt;br/&gt;
How your materialized view is created and refreshed, what is the pipeline? What does the spec of the change stream look like?&lt;/p&gt;</comment>
                            <comment id="5514402" author="JIRAUSER1274183" created="Wed, 21 Jun 2023 06:52:23 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=chris.kelly%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;chris.kelly@mongodb.com&quot;&gt;chris.kelly@mongodb.com&lt;/a&gt;&#160;&lt;/p&gt;

&lt;p&gt;Thank you for your quick reply!&lt;/p&gt;

&lt;p&gt;Sorry, my initial description had lost p.5 for some reason, where I did refresh my materialized view.&lt;/p&gt;

&lt;p&gt;Steps to reproduce:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create collection C1&lt;/li&gt;
	&lt;li&gt;Create the on-demand materialized view MV1 on the C1 with all matched&lt;/li&gt;
	&lt;li&gt;Watch MV1&lt;/li&gt;
	&lt;li&gt;Insert something in C1&lt;/li&gt;
	&lt;li&gt;Refresh MV1&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Did I get your answer correctly that Views (including materialized views) CANNOT be watched by Change Stream API?&lt;/p&gt;

&lt;p&gt;If yes, I would expect to get a clear error when trying to watch materialized views.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;In my use case, MV1 has a grouped representation of an underlying collection, so it makes only sense to watch MV1, not C1.&lt;/p&gt;

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

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="5512999" author="JIRAUSER1265262" created="Tue, 20 Jun 2023 17:28:06 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=k.chaus%40efg.gg&quot; class=&quot;user-hover&quot; rel=&quot;k.chaus@efg.gg&quot;&gt;k.chaus@efg.gg&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Thanks for concisely summarizing the issue. Some notes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Views (including materialized views) are &lt;a href=&quot;https://www.mongodb.com/docs/manual/core/views/#read-only&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;read-only&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;For change streams, you should watch the underlying collection(s) the view is based on.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-31720&quot; title=&quot;Provide a way to get notification when results of a query change&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-31720&quot;&gt;SERVER-31720&lt;/a&gt; is on the backlog which would likely cover the use case you&apos;re suggesting (Provide a way to get notification when results of a query change), and I would suggest looking there to push on that if it&apos;s a feature you feel strongly about.&lt;/li&gt;
	&lt;li&gt;Additionally, one extra note is that you must &lt;a href=&quot;https://www.mongodb.com/docs/manual/core/materialized-views/#3.-refresh-materialized-view&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;refresh your materialized view&lt;/a&gt; to have any changes in the underlying collection(s) reflected in your view.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This does not appear explicit in the change stream docs, and pointing that out is valuable for us. I&apos;ll forward this suggestion so we can get this limit clearly displayed!&lt;/p&gt;

&lt;p&gt;Christopher&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2372484">SERVER-78232</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 20 Jun 2023 17:28:06 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        22 weeks, 5 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>kateryna.kamenieva@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            22 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>chris.kelly@mongodb.com</customfieldvalue>
            <customfieldvalue>kateryna.kamenieva@mongodb.com</customfieldvalue>
            <customfieldvalue>k.chaus@efg.gg</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2ell3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1wskg:</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;ol&gt;
	&lt;li&gt;Create collection C1&lt;/li&gt;
	&lt;li&gt;Create the on-demand materialized view MV1 on the C1 with all matched&lt;/li&gt;
	&lt;li&gt;Watch MV1&lt;/li&gt;
	&lt;li&gt;Insert something in C1&lt;/li&gt;
	&lt;li&gt;&#160;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;b&gt;Expected&lt;/b&gt;:&lt;/p&gt;

&lt;p&gt;The change in MV1 is caught by the watcher&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Actual&lt;/b&gt;:&lt;/p&gt;

&lt;p&gt;The change in MV1 is NOT caught by the watcher&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[chris.kelly@mongodb.com]]></customfieldvalue>
    

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

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