<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:36:11 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>[GODRIVER-1335] Pipe &amp; iter types equivalent in new golang driver</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1335</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;Hello ,&lt;/p&gt;

&lt;p&gt;I leverage mongoeye(&lt;a href=&quot;https://github.com/mongoeye&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongoeye&lt;/a&gt;) which leverages mgo.v2(&lt;a href=&quot;https://godoc.org/gopkg.in/mgo.v2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://godoc.org/gopkg.in/mgo.v2&lt;/a&gt;) for getting key info &amp;amp; types across collection . I ran into edge-cases around ssl &amp;amp; authmechanism which new driver addresses . however, i am wondering if there is any roadmap to create mgo.Pipe &amp;amp; Mgo.Iter types in newest driver or their functionality or if there is a way to grab key info across collection in newest driver&lt;/p&gt;

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

&lt;p&gt;thanks&lt;/p&gt;

&lt;p&gt;chakri&lt;/p&gt;</description>
                <environment></environment>
        <key id="965895">GODRIVER-1335</key>
            <summary>Pipe &amp; iter types equivalent in new golang driver</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="divjot.arora@mongodb.com">Divjot Arora</assignee>
                                    <reporter username="chakri123@gmail.com">chakrapani velugubantla</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Oct 2019 16:44:59 +0000</created>
                <updated>Mon, 28 Oct 2019 20:02:10 +0000</updated>
                            <resolved>Mon, 28 Oct 2019 20:02:10 +0000</resolved>
                                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="2477990" author="divjot.arora" created="Fri, 11 Oct 2019 14:48:48 +0000"  >&lt;p&gt;Thanks for the clarification &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=chakri123%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;chakri123@gmail.com&quot;&gt;chakri123@gmail.com&lt;/a&gt;. The &lt;tt&gt;BatchSize&lt;/tt&gt; and &lt;tt&gt;AllowDiskUse&lt;/tt&gt; options can be leveraged through the &lt;tt&gt;options&lt;/tt&gt; package. I don&apos;t know what kind of pipeline you&apos;d need off the top of my head to get the keys in a collection. Looking at your code sample, however, it seems like you have multiple stages, each of which is a &lt;tt&gt;bson.M&lt;/tt&gt;. You can do the same thing in the Go driver as the &lt;tt&gt;pipeline&lt;/tt&gt; parameter will accept a slice of documents. To put it all together, here&apos;s a small code sample:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: #008200; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;// stages is []bson.M&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;aggregateOptions := options.Aggregate().SetBatchSize(&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;).AllowDiskUse(&lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;cursor, err := coll.Aggregate(context.Background, stages, aggregateOptions)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; err != nil { log.Fatal(err) }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: #008200; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;// iterate cursor to get each document returned by the aggregation&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;Let us know if you have any other questions about aggregations in the driver.&lt;/p&gt;

&lt;p&gt;&amp;#8211; Divjot&lt;/p&gt;</comment>
                            <comment id="2477729" author="chakri123@gmail.com" created="Fri, 11 Oct 2019 12:47:15 +0000"  >&lt;p&gt;Hello ,&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/233473/233473_pipeline.go&quot; title=&quot;pipeline.go attached to GODRIVER-1335&quot;&gt;pipeline.go&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&#160;im looking for batch &amp;amp; allowdiskuse functions for pipe wondering if these were part of aggregations .&#160;&lt;/p&gt;

&lt;p&gt;regarding grab keys. to elaborate on that.. is there a way to get all keys within a collection for example:&lt;/p&gt;

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

&lt;p&gt;collection doc sample will be&#160;&lt;/p&gt;

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

{&quot;key1&quot;: &quot;val1&quot; , &quot;key2&quot; : &quot;val2&quot; , &quot;key3&quot; : [ \{&quot;key3-1&quot; : &quot;val3-1&quot; , &quot;key-3-2&quot; : &quot;val-3-2&quot; }
&lt;p&gt;]}&lt;/p&gt;

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

&lt;p&gt;looking for a way to get key1, key2 , key3.key3-1 , key3.key-3-2&#160;&lt;/p&gt;

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

&lt;p&gt;thanks&lt;/p&gt;

&lt;p&gt;CHakri&lt;/p&gt;

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

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="2476542" author="divjot.arora" created="Thu, 10 Oct 2019 20:55:16 +0000"  >&lt;p&gt;Also, we weren&apos;t sure what you meant by &quot;grab key info across collection&quot;. Can you elaborate on this?&lt;/p&gt;</comment>
                            <comment id="2476538" author="divjot.arora" created="Thu, 10 Oct 2019 20:54:37 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=chakri123%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;chakri123@gmail.com&quot;&gt;chakri123@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Looking at the mgo source code, it looks like the &lt;tt&gt;Pipe&lt;/tt&gt; type is used for aggregations, which can be done through the &lt;tt&gt;Collection.Aggregate&lt;/tt&gt; and &lt;tt&gt;Database.Aggregate&lt;/tt&gt; functions in the driver. The &lt;tt&gt;Iter&lt;/tt&gt; type maps to the driver&apos;s &lt;tt&gt;mongo.Cursor&lt;/tt&gt; type, which is returned from functions like &lt;tt&gt;Find&lt;/tt&gt; and &lt;tt&gt;Aggregate&lt;/tt&gt;. Is there specific functionality from the mgo types that you need that isn&apos;t present in the driver?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="233473" name="pipeline.go" size="2762" author="chakri123@gmail.com" created="Fri, 11 Oct 2019 12:42:49 +0000"/>
                    </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|hvldqf:</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>