<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:59:05 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>[JAVA-3225] ChangeStreamDocument does not have getters for txnNumber and lsid fields</title>
                <link>https://jira.mongodb.org/browse/JAVA-3225</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;According to the &lt;a href=&quot;http://mongodb.github.io/mongo-java-driver/3.10/javadoc/com/mongodb/client/model/changestream/ChangeStreamDocument.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ChangeStreamDocument&lt;/a&gt; api, there are no getter methods for &lt;tt&gt;txnNumber&lt;/tt&gt; and &lt;tt&gt;lsid&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;From the &lt;a href=&quot;https://docs.mongodb.com/manual/reference/change-events/#change-stream-output&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;manual&lt;/a&gt;, these fields do exist when the operation is part of a transaction.&lt;/p&gt;

&lt;p&gt;Would you be able to extend the &lt;tt&gt;ChangeStreamDocument&lt;/tt&gt; class to include the above fields?&lt;/p&gt;

&lt;p&gt;Is this related to &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2406&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;CSHARP-2406&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;I did try to implement my own POJO to use in &lt;tt&gt;ChangeStreamIterable.withDocumentClass()&lt;/tt&gt;. I got as far as registering the class&apos;s codec into the &lt;tt&gt;MongoClient.codecRegistry()&lt;/tt&gt;. However, I was not successful. If there is a recommended approach without using the getters, please let me know.&lt;/p&gt;</description>
                <environment></environment>
        <key id="715062">JAVA-3225</key>
            <summary>ChangeStreamDocument does not have getters for txnNumber and lsid fields</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="john.stewart@mongodb.com">John Stewart</assignee>
                                    <reporter username="steve.choi@mongodb.com">Steve Choi</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Mar 2019 22:34:51 +0000</created>
                <updated>Sat, 28 Oct 2023 11:22:19 +0000</updated>
                            <resolved>Mon, 22 Jul 2019 17:49:06 +0000</resolved>
                                    <version>4.0.0</version>
                                    <fixVersion>3.11.0</fixVersion>
                                    <component>Change Streams</component>
                                        <votes>2</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="2337061" author="xgen-internal-githook" created="Mon, 22 Jul 2019 17:48:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;John Stewart&apos;, &apos;username&apos;: &apos;jstewart-mongo&apos;, &apos;email&apos;: &apos;john.stewart@mongodb.com&apos;}
&lt;p&gt;Message: Add getters for txnNumber and lsid fields to ChangeStreamDocument&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-3225&quot; title=&quot;ChangeStreamDocument does not have getters for txnNumber and lsid fields&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-3225&quot;&gt;&lt;del&gt;JAVA-3225&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/b6631daa8938810cbb99941bcb6b200a2c2ab071&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/b6631daa8938810cbb99941bcb6b200a2c2ab071&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2198452" author="jeff.yemin" created="Mon, 1 Apr 2019 21:42:10 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alberto.forti%40rbs.com&quot; class=&quot;user-hover&quot; rel=&quot;alberto.forti@rbs.com&quot;&gt;alberto.forti@rbs.com&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=steve.choi&quot; class=&quot;user-hover&quot; rel=&quot;steve.choi&quot;&gt;steve.choi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One important point about reliance on clusterTime: when transactions are supported in sharded clusters in MongoDB 4.2, it will be possible for multiple unrelated transactions executing on different shards to share the same cluster time, so it will be safer to rely on txnNumber and lsid to distinguish between unrelated transactions sharing the same cluster time.  We will add properties for them in the next release.&lt;/p&gt;
</comment>
                            <comment id="2198398" author="jeff.yemin" created="Mon, 1 Apr 2019 21:19:14 +0000"  >&lt;p&gt;Conclusion: Add&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;txnNumber&lt;/li&gt;
	&lt;li&gt;lsid&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;to ChangeStreamDocument&lt;/p&gt;</comment>
                            <comment id="2179414" author="alberto.forti@rbs.com" created="Wed, 13 Mar 2019 13:58:16 +0000"  >&lt;p&gt;Hi Jeff,&lt;/p&gt;

&lt;p&gt;I&apos;m trying to implement a materialized view of a collection updated with multi-document transactions. I was thinking of using the txnNumber in the change stream to identify changes beloging to the same transaction and replicate the same on the view. I&apos;ve now realised that all changes belonging to the same transaction have the same ClusterTime and different transactions have different cluster times... so I think I can use the cluster time for that purpose. Can you please confirm? Thanks.&lt;/p&gt;</comment>
                            <comment id="2177857" author="jeff.yemin" created="Mon, 11 Mar 2019 22:52:55 +0000"  >&lt;p&gt;As a workaround, you can always decode into instances of the &lt;tt&gt;org.bson.Document&lt;/tt&gt; class.&lt;/p&gt;</comment>
                            <comment id="2177846" author="jeff.yemin" created="Mon, 11 Mar 2019 22:43:34 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=steve.choi&quot; class=&quot;user-hover&quot; rel=&quot;steve.choi&quot;&gt;steve.choi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;m curious what you plan to do with those fields if you did have access to them.  &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="727487">DOCS-12588</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000dODFDQA4]]]></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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6t3r:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>