<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:02:27 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-4583] Stop using null values in the Scala query building API for $setWindowFields</title>
                <link>https://jira.mongodb.org/browse/JAVA-4583</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;While this API is still marked as &lt;tt&gt;@Beta&lt;/tt&gt;, we have a chance to change the docs and maybe the wrappers such that the API can be used without passing &lt;tt&gt;null&lt;/tt&gt; values, as using them is &lt;a href=&quot;https://docs.scala-lang.org/overviews/scala-book/no-null-values.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;discouraged in Scala 2&lt;/a&gt; (and &lt;a href=&quot;https://docs.scala-lang.org/scala3/reference/other-new-features/explicit-nulls.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt; is something about &lt;tt&gt;null&lt;/tt&gt; s in Scala 3).&lt;/p&gt;

&lt;p&gt;The API was added in this &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/78b27e834fc1c279ca43fcfd3e926f9b10afd3d7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;commit&lt;/a&gt;, and uses &lt;tt&gt;null&lt;/tt&gt; in the following program elements:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;tt&gt;Aggregates.setWindowFields&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;WindowedComputations&lt;/tt&gt; and many of its methods&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Also, the test &lt;tt&gt;&quot;render $setWindowFields with no partitionBy/sortBy&quot;&lt;/tt&gt; passes &lt;tt&gt;null&lt;/tt&gt; s when uses the API.&lt;/p&gt;

&lt;p&gt;We should start accepting &lt;tt&gt;scala.Option&lt;/tt&gt; for &lt;tt&gt;null&lt;/tt&gt;-able parameters.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2029527">JAVA-4583</key>
            <summary>Stop using null values in the Scala query building API for $setWindowFields</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="9">Done</resolution>
                                        <assignee username="valentin.kovalenko@mongodb.com">Valentin Kavalenka</assignee>
                                    <reporter username="valentin.kovalenko@mongodb.com">Valentin Kavalenka</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Apr 2022 20:38:56 +0000</created>
                <updated>Tue, 17 May 2022 23:16:31 +0000</updated>
                            <resolved>Tue, 17 May 2022 23:16:31 +0000</resolved>
                                                    <fixVersion>4.7.0</fixVersion>
                                    <component>Builders</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="4554748" author="xgen-internal-githook" created="Tue, 17 May 2022 21:25:07 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Valentin Kovalenko&apos;, &apos;email&apos;: &apos;valentin.kovalenko@mongodb.com&apos;, &apos;username&apos;: &apos;stIncMale&apos;}
&lt;p&gt;Message: Stop using `null` values in the Scala query building API for `$setWindowFields` (#937)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-4583&quot; title=&quot;Stop using null values in the Scala query building API for $setWindowFields&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-4583&quot;&gt;&lt;del&gt;JAVA-4583&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/4a6f2c0fb13cfc9c707e0bd3e82ad190d242edca&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/4a6f2c0fb13cfc9c707e0bd3e82ad190d242edca&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10020">
                    <name>Gantt Dependency</name>
                                            <outwardlinks description="has to be done before">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10011"><![CDATA[Minor Change]]></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_10257" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Documentation Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10250"><![CDATA[Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14266" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Documentation Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;We need to update examples in &lt;a href=&quot;https://mongodb.github.io/mongo-java-driver/4.6/driver-scala/builders/aggregation/#setwindowfields&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mongodb.github.io/mongo-java-driver/4.6/driver-scala/builders/aggregation/#setwindowfields&lt;/a&gt; such that they wrap references in `Some` where needed:&lt;/p&gt;

&lt;p&gt;val pastMonth: Window = Windows.timeRange(-1, MongoTimeUnit.MONTH, Windows.Bound.CURRENT)&lt;br/&gt;
setWindowFields(Some(&quot;$localityId&quot;), Some(Sorts.ascending(&quot;measurementDateTime&quot;)),&lt;br/&gt;
  WindowedComputations.sum(&quot;monthlyRainfall&quot;, &quot;$rainfall&quot;, Some(pastMonth)),&lt;br/&gt;
  WindowedComputations.avg(&quot;monthlyAvgTemp&quot;, &quot;$temperature&quot;, Some(pastMonth)))&lt;/p&gt;

&lt;p&gt;P.S. Note also that the order of arguments passed to the `timeRange` differs from that in the currently published example. This is because the order in the currently published example is incorrect.&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr3mmh:0400jr</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>