<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:44 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-1069] aggregation query from 2 tables</title>
                <link>https://jira.mongodb.org/browse/JAVA-1069</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;we have a schema:&lt;/p&gt;

&lt;p&gt;stores:&lt;br/&gt;
{_id , name}&lt;br/&gt;
getways: &lt;br/&gt;
{_id, store_id }&lt;br/&gt;
txes:&lt;/p&gt;
{tx_id,getway_id}

&lt;p&gt;store has many getways, and getway has many txes.&lt;/p&gt;

&lt;p&gt;We need count of txes for specific store.&lt;/p&gt;

&lt;p&gt;in sql:&lt;/p&gt;

&lt;p&gt;select count&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/star_yellow.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
from txes&lt;br/&gt;
where getway_id in&lt;br/&gt;
                  ( select _id &lt;br/&gt;
                    from getways&lt;br/&gt;
                    where store_id = xxxx)&lt;/p&gt;

&lt;p&gt;How can I write it in mongo query?&lt;/p&gt;

&lt;p&gt;I write this query in jaspersoft studio mongo query.&lt;/p&gt;

&lt;p&gt;Thanks for your help&lt;/p&gt;</description>
                <environment></environment>
        <key id="104556">JAVA-1069</key>
            <summary>aggregation query from 2 tables</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="-1">Unassigned</assignee>
                                    <reporter username="litalch@3base.co.il">lital</reporter>
                        <labels>
                            <label>aggregation</label>
                            <label>jaspersoft</label>
                            <label>subquery</label>
                    </labels>
                <created>Sun, 5 Jan 2014 12:28:51 +0000</created>
                <updated>Wed, 11 Sep 2019 19:12:03 +0000</updated>
                            <resolved>Sun, 5 Jan 2014 14:04:57 +0000</resolved>
                                                                    <component>JSON</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="477346" author="jeff.yemin" created="Sun, 5 Jan 2014 14:04:32 +0000"  >&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;This Jira project is intended for reporting bugs and requesting enhancements to the MongoDB Java driver.  So even though you may be trying to accomplish your goal using the Java driver, the question is really a more general one about MongoDB schema design, which is better handled on either Stack Overflow or the &lt;a href=&quot;https://groups.google.com/forum/#!forum/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user Google group&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks in advance for your understanding.&lt;/p&gt;</comment>
                    </comments>
                    <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|hrv5jr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>95727</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>