<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:01:16 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>[CXX-1059] Add aggregation pipeline class builder methods for new MongoDB 3.4 stages and $geoNear / $indexStats stages</title>
                <link>https://jira.mongodb.org/browse/CXX-1059</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;The pipeline class is currently missing methods associated with the &lt;a href=&quot;https://docs.mongodb.com/master/release-notes/3.4/#aggregation&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;new-in-MongoDB-3.4 pipeline stages&lt;/a&gt;:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;$addFields&lt;/li&gt;
	&lt;li&gt;$bucket&lt;/li&gt;
	&lt;li&gt;$bucketAuto&lt;/li&gt;
	&lt;li&gt;$count&lt;/li&gt;
	&lt;li&gt;$collStats&lt;/li&gt;
	&lt;li&gt;$facet&lt;/li&gt;
	&lt;li&gt;$graphLookup&lt;/li&gt;
	&lt;li&gt;$replaceRoot&lt;/li&gt;
	&lt;li&gt;$sortByCount&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;It is also missing a method associated with the &lt;a href=&quot;https://docs.mongodb.com/master/reference/operator/aggregation/indexStats/#pipe._S_indexStats&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;$indexStats&lt;/a&gt; stage (new in MongoDB 3.2), and the $geoNear stage.&lt;/p&gt;

&lt;p&gt;In addition, pipeline::unwind() needs a new overload that allows users to specify values for the &lt;a href=&quot;https://docs.mongodb.com/manual/reference/operator/aggregation/unwind/#pipe._S_unwind&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&quot;includeArrayIndex&quot; and &quot;preserveNullAndEmptyArrays&quot; options&lt;/a&gt; (new in MongoDB 3.2).&lt;/p&gt;

&lt;p&gt;We should either add new builder methods to the pipeline class for all of these new stages, or we should deprecate the pipeline class entirely and instead have users pass array builders directly to collection::aggregate().&lt;/p&gt;</description>
                <environment></environment>
        <key id="320320">CXX-1059</key>
            <summary>Add aggregation pipeline class builder methods for new MongoDB 3.4 stages and $geoNear / $indexStats stages</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="9">Done</resolution>
                                        <assignee username="rassi">J Rassi</assignee>
                                    <reporter username="rassi">J Rassi</reporter>
                        <labels>
                    </labels>
                <created>Sat, 1 Oct 2016 18:04:36 +0000</created>
                <updated>Tue, 13 Dec 2016 16:48:29 +0000</updated>
                            <resolved>Mon, 28 Nov 2016 23:24:51 +0000</resolved>
                                                    <fixVersion>3.1.0</fixVersion>
                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1445040" author="xgen-internal-githook" created="Tue, 29 Nov 2016 18:51:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jrassi&apos;, u&apos;name&apos;: u&apos;J. Rassi&apos;, u&apos;email&apos;: u&apos;rassi@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1059&quot; title=&quot;Add aggregation pipeline class builder methods for new MongoDB 3.4 stages and $geoNear / $indexStats stages&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1059&quot;&gt;&lt;del&gt;CXX-1059&lt;/del&gt;&lt;/a&gt; Add new stage methods to pipeline class&lt;/p&gt;

&lt;p&gt;As a result of this work, this pipeline class is now up-to-date with&lt;br/&gt;
new functionality available in the aggregation framework as of server&lt;br/&gt;
version 3.4.&lt;/p&gt;

&lt;p&gt;Complete list of methods added:&lt;/p&gt;

&lt;p&gt;    pipeline&amp;amp; add_fields(bsoncxx::document::view_or_value fields_to_add);&lt;br/&gt;
    pipeline&amp;amp; bucket(bsoncxx::document::view_or_value bucket_args);&lt;br/&gt;
    pipeline&amp;amp; bucket_auto(bsoncxx::document::view_or_value bucket_auto_args);&lt;br/&gt;
    pipeline&amp;amp; coll_stats(bsoncxx::document::view_or_value coll_stats_args);&lt;br/&gt;
    pipeline&amp;amp; count(std::string field);&lt;br/&gt;
    pipeline&amp;amp; facet(bsoncxx::document::view_or_value facet_args);&lt;br/&gt;
    pipeline&amp;amp; geo_near(bsoncxx::document::view_or_value geo_near_args);&lt;br/&gt;
    pipeline&amp;amp; graph_lookup(bsoncxx::document::view_or_value graph_lookup_args);&lt;br/&gt;
    pipeline&amp;amp; index_stats();&lt;br/&gt;
    pipeline&amp;amp; replace_root(bsoncxx::document::view_or_value replace_root_args);&lt;br/&gt;
    pipeline&amp;amp; sort_by_count(bsoncxx::document::view_or_value field_expression);&lt;br/&gt;
    pipeline&amp;amp; sort_by_count(std::string field_expression);&lt;br/&gt;
    pipeline&amp;amp; unwind(bsoncxx::document::view_or_value unwind_args);&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/764886c4b262aa89f069ae29ed771bb86d542dbf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/764886c4b262aa89f069ae29ed771bb86d542dbf&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1445039" author="xgen-internal-githook" created="Tue, 29 Nov 2016 18:51:08 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jrassi&apos;, u&apos;name&apos;: u&apos;J. Rassi&apos;, u&apos;email&apos;: u&apos;rassi@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1059&quot; title=&quot;Add aggregation pipeline class builder methods for new MongoDB 3.4 stages and $geoNear / $indexStats stages&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1059&quot;&gt;&lt;del&gt;CXX-1059&lt;/del&gt;&lt;/a&gt; Minor cleanup of pipeline.cpp/pipeline.hpp&lt;/p&gt;

&lt;p&gt;Simplify implementation, clean up documentation, fix naming of a few&lt;br/&gt;
parameters.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/220ecf828ec96c244e34dc75e20376985107f7b0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/220ecf828ec96c244e34dc75e20376985107f7b0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1444060" author="xgen-internal-githook" created="Mon, 28 Nov 2016 23:24:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jrassi&apos;, u&apos;name&apos;: u&apos;J. Rassi&apos;, u&apos;email&apos;: u&apos;rassi@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1059&quot; title=&quot;Add aggregation pipeline class builder methods for new MongoDB 3.4 stages and $geoNear / $indexStats stages&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1059&quot;&gt;&lt;del&gt;CXX-1059&lt;/del&gt;&lt;/a&gt; Add new stage methods to pipeline class&lt;/p&gt;

&lt;p&gt;As a result of this work, this pipeline class is now up-to-date with&lt;br/&gt;
new functionality available in the aggregation framework as of server&lt;br/&gt;
version 3.4.&lt;/p&gt;

&lt;p&gt;Complete list of methods added:&lt;/p&gt;

&lt;p&gt;    pipeline&amp;amp; add_fields(bsoncxx::document::view_or_value fields_to_add);&lt;br/&gt;
    pipeline&amp;amp; bucket(bsoncxx::document::view_or_value bucket_args);&lt;br/&gt;
    pipeline&amp;amp; bucket_auto(bsoncxx::document::view_or_value bucket_auto_args);&lt;br/&gt;
    pipeline&amp;amp; coll_stats(bsoncxx::document::view_or_value coll_stats_args);&lt;br/&gt;
    pipeline&amp;amp; count(std::string field);&lt;br/&gt;
    pipeline&amp;amp; facet(bsoncxx::document::view_or_value facet_args);&lt;br/&gt;
    pipeline&amp;amp; geo_near(bsoncxx::document::view_or_value geo_near_args);&lt;br/&gt;
    pipeline&amp;amp; graph_lookup(bsoncxx::document::view_or_value graph_lookup_args);&lt;br/&gt;
    pipeline&amp;amp; index_stats();&lt;br/&gt;
    pipeline&amp;amp; replace_root(bsoncxx::document::view_or_value replace_root_args);&lt;br/&gt;
    pipeline&amp;amp; sort_by_count(bsoncxx::document::view_or_value field_expression);&lt;br/&gt;
    pipeline&amp;amp; sort_by_count(std::string field_expression);&lt;br/&gt;
    pipeline&amp;amp; unwind(bsoncxx::document::view_or_value unwind_args);&lt;br/&gt;
Branch: 3.1-dev&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/764886c4b262aa89f069ae29ed771bb86d542dbf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/764886c4b262aa89f069ae29ed771bb86d542dbf&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1444059" author="xgen-internal-githook" created="Mon, 28 Nov 2016 23:24:38 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jrassi&apos;, u&apos;name&apos;: u&apos;J. Rassi&apos;, u&apos;email&apos;: u&apos;rassi@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1059&quot; title=&quot;Add aggregation pipeline class builder methods for new MongoDB 3.4 stages and $geoNear / $indexStats stages&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1059&quot;&gt;&lt;del&gt;CXX-1059&lt;/del&gt;&lt;/a&gt; Minor cleanup of pipeline.cpp/pipeline.hpp&lt;/p&gt;

&lt;p&gt;Simplify implementation, clean up documentation, fix naming of a few&lt;br/&gt;
parameters.&lt;br/&gt;
Branch: 3.1-dev&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/220ecf828ec96c244e34dc75e20376985107f7b0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/220ecf828ec96c244e34dc75e20376985107f7b0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1425735" author="david.golden" created="Thu, 3 Nov 2016 22:17:36 +0000"  >&lt;p&gt;We also considered doing #1 to meet our 3.1 release goal and deferring options 2-4 for a post-3.1 release.  (If we are considering dropping/deprecating pipeline builders or making other breaking API changes, we should queue that for 4.0 anyway.)&lt;/p&gt;

&lt;p&gt;If we don&apos;t get insight into #2 or #3 in the next week or so, I think we should move forward with #1 to close this ticket and open a new ticket for the other options on the table.&lt;/p&gt;</comment>
                            <comment id="1425649" author="rassi@10gen.com" created="Thu, 3 Nov 2016 21:13:39 +0000"  >&lt;p&gt;Me and David spoke in-person today about this.  We discussed the following approaches:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Add builder methods for the above stages.  This has the advantage of following the existing convention, and deferring further design improvements.  It has the disadvantage that 3.1.0 users will not be able to use MongoDB 3.6 with pipeline stages that are new in that release.&lt;/li&gt;
	&lt;li&gt;Add builder methods for the above stages, and also add a new method that allows users to specify the name of the pipeline stage manually (perhaps with something like &quot;pipeline::append_other(string, document)&quot;).  This has the advantage of being a relatively small change to the pipeline class, while providing forwards-compatibility.  It has the disadvantage in that this new method is an awkward addition to the pipeline class (which we&apos;re not sure yet if we should be maintaining long-term).&lt;/li&gt;
	&lt;li&gt;Add a collection::aggregate() overload that takes an array::view_or_value instead of a pipeline.  This has the advantage of offering a forwards-compatible and familiar API to users, and allows us to consider deprecating the existing overload and the pipeline class.  It has the disadvantage of requiring more verbose code to express a pipeline than the existing API.  If we take this route, we could optionally add some infrastructure in bsoncxx or mongocxx to make it easier to make building pipelines less verbose, and we could optionally perform the deprecations now (if we decide not to do the deprecations, we should add builder methods for the above stages, too).&lt;/li&gt;
	&lt;li&gt;Add the new collection::aggregate() method as in #3, and remove the existing method entirely.  We could then add an implicit conversion from pipeline to array::view_or_value, to permit existing code to still work.  (For academic purposes, note that this approach breaks ABI.)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Further research on what the approaches the other statically-typed languages take here would be useful.&lt;/p&gt;</comment>
                            <comment id="1403130" author="david.golden" created="Fri, 7 Oct 2016 17:14:07 +0000"  >&lt;p&gt;Also, consider overloading the aggregate command to take an arbitrary user document as the pipeline.&lt;/p&gt;</comment>
                            <comment id="1403127" author="david.golden" created="Fri, 7 Oct 2016 17:11:10 +0000"  >&lt;p&gt;Per discussions: another possibility is add ability to add arbitrary stage for forward compatibility.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="334026">CXX-1147</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <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|hrc34v:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1351">Perl/CXX 2016-11-11</customfieldvalue>
    <customfieldvalue id="1392">Perl/CXX 2016-12-02</customfieldvalue>

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