<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:53:24 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-213] Array.fetchRefs( colName ) ( WAS : db.col.findOne().val.fetchAll() for lists of DBRefs )</title>
                <link>https://jira.mongodb.org/browse/SERVER-213</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The shell provides a way to fetch a DBRef&apos;d document into the current one. It would be very useful to be able to do this on a list/array value - each document in an array which looks like a DBRef is fetched into the current doc. An example to illustrate the concept:&lt;/p&gt;

&lt;p&gt;&amp;gt; var other = &lt;/p&gt;
{ s : &quot;other thing&quot;, n : 1}
&lt;p&gt;;&lt;br/&gt;
&amp;gt; db.otherthings.save(other);&lt;br/&gt;
&amp;gt; db.otherthings.find();&lt;/p&gt;
{&quot;_id&quot; : &quot;497dbcb36b27d59a708e89a4&quot; , &quot;s&quot; : &quot;other thing&quot; , &quot;n&quot; : 1}
&lt;p&gt;&amp;gt; var another = &lt;/p&gt;
{ s : &quot;another thing&quot;, n : 2}
&lt;p&gt;;&lt;br/&gt;
&amp;gt; db.otherthings.save(another);&lt;br/&gt;
&amp;gt; db.otherthings.find();&lt;/p&gt;
{&quot;_id&quot; : &quot;4a7aabf13240ba3080db97dd&quot; , &quot;s&quot; : &quot;another thing&quot; , &quot;n&quot; : 2}
&lt;p&gt;&amp;gt; var mongo = db.things.findOne();&lt;br/&gt;
&amp;gt; print(tojson(mongo));&lt;br/&gt;
{&quot;_id&quot; : &quot;497dab624ee47b3a675d2d9c&quot; , &quot;name&quot; : &quot;mongo&quot; , &quot;type&quot; : &quot;database&quot; , &quot;data&quot; : {&quot;a&quot; : 1 , &quot;b&quot; : 2}}&lt;br/&gt;
&amp;gt; mongo.otherthings = &lt;span class=&quot;error&quot;&gt;&amp;#91;new DBRef( &amp;#39;otherthings&amp;#39; , other._id ), new DBRef( &amp;#39;otherthings&amp;#39; , another._id )&amp;#93;&lt;/span&gt;;&lt;/p&gt;
{&quot;s&quot; : &quot;other thing&quot; , &quot;n&quot; : 1 , &quot;_id&quot; : &quot;497dbcb36b27d59a708e89a4&quot;}
&lt;p&gt;&amp;gt; db.things.save(mongo);&lt;br/&gt;
&amp;gt; db.things.findOne().otherthings.fetchAll();&lt;br/&gt;
{&quot;_id&quot; : &quot;497dab624ee47b3a675d2d9c&quot; , &quot;name&quot; : &quot;mongo&quot; , &quot;type&quot; : &quot;database&quot; , &quot;data&quot; : &lt;/p&gt;
{&quot;a&quot; : 1 , &quot;b&quot; : 2}
&lt;p&gt; , &quot;otherthings&quot; : [ &lt;/p&gt;
{&quot;_id&quot; : &quot;497dbcb36b27d59a708e89a4&quot; , &quot;s&quot; : &quot;other thing&quot; , &quot;n&quot; : 1}
&lt;p&gt;, &lt;/p&gt;
{&quot;_id&quot; : &quot;4a7aabf13240ba3080db97dd&quot; , &quot;s&quot; : &quot;another thing&quot; , &quot;n&quot; : 2}
&lt;p&gt; ] }&lt;/p&gt;</description>
                <environment></environment>
        <key id="10400">SERVER-213</key>
            <summary>Array.fetchRefs( colName ) ( WAS : db.col.findOne().val.fetchAll() for lists of DBRefs )</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="eliot">Eliot Horowitz</assignee>
                                    <reporter username="digitala">Phillip Oldham</reporter>
                        <labels>
                    </labels>
                <created>Thu, 6 Aug 2009 06:11:57 +0000</created>
                <updated>Tue, 12 Jul 2016 00:27:51 +0000</updated>
                            <resolved>Mon, 5 Oct 2009 16:02:44 +0000</resolved>
                                                    <fixVersion>1.1.2</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="10907" author="eliot" created="Fri, 16 Oct 2009 15:33:20 +0000"  >&lt;p&gt;release 10/16/2009&lt;/p&gt;</comment>
                            <comment id="10496" author="eliot" created="Mon, 17 Aug 2009 10:18:26 +0000"  >&lt;p&gt;I&apos;m thinking it would stay as fetch()&lt;br/&gt;
its fundamentally different since the method on an array will be on any array - so might be confusing otherwise.&lt;br/&gt;
could make fetchRef and fetch work on a regular dbref though&lt;/p&gt;</comment>
                            <comment id="10495" author="digitala" created="Mon, 17 Aug 2009 10:13:44 +0000"  >&lt;p&gt;&quot;maybe we should add a _ns field to the objects to se know which collection they came from&quot;&lt;/p&gt;

&lt;p&gt;Sounds good.&lt;/p&gt;

&lt;p&gt;Will there be a corresponding .fetchRef() then, for singular DBRef instances? Or will this stay as .fetch()?&lt;/p&gt;</comment>
                            <comment id="10494" author="eliot" created="Mon, 17 Aug 2009 09:57:21 +0000"  >&lt;p&gt;Going to add a method to Array&lt;/p&gt;

&lt;p&gt;fetchRefs( collectionName )&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;collectionName is optional&lt;br/&gt;
   if specified, only return refs to that collection, otherwise return objects from all&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;maybe we should add a _ns field to the objects to se know which collection they came from...&lt;/p&gt;</comment>
                            <comment id="10492" author="digitala" created="Mon, 17 Aug 2009 02:45:51 +0000"  >&lt;p&gt;Sounds ok. The reason I mentioned replacing the array items is that if it&apos;s a mixed array it would make more sense, but as long as it can recognise the DBRefs in the array and collect those documents that should be fine. However, if the DBRefs link to documents in different collections, how would one know which collection a doc came from in the returned results?&lt;/p&gt;</comment>
                            <comment id="10490" author="eliot" created="Sun, 16 Aug 2009 20:26:01 +0000"  >&lt;p&gt;How would you feel about fetchAll() returning a list rather than replacing the list?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sun, 16 Aug 2009 20:26:01 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        14 years, 18 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            14 years, 18 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>digitala</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpwuf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hriv1r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>23683</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_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

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

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