<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:36:53 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-1673] The Filter query on nested sub-document array is not returning results </title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1673</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;The data is stored as:&lt;/p&gt;
{
&#160; &#160;&quot;_id&quot;:\{&quot;$oid&quot;:&quot;5e7b22bd2a7912a5a3b73d79&quot;}
&lt;p&gt;,&lt;br/&gt;
&#160; &#160;&quot;manufacturerID&quot;:&quot;19193&quot;,&lt;br/&gt;
&#160; &#160;&quot;units&quot;:[&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &quot;assetsReserved&quot;:{&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &quot;departmentCode&quot; : &quot;PHY_DEPTS&quot;,&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &quot;assets&quot;:{&quot;primaryID&quot;:&quot;1234&quot;}}&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; },&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;{&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&quot;departmentCode&quot; : &quot;PHY_DEPTS&quot;,&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &quot;assetsReserved&quot;:{&quot;assets&quot;:{&quot;primaryID&quot;:&quot;4567&quot;}}&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;}&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160;]&lt;br/&gt;
}&lt;br/&gt;
The requirement is to get all the units where primaryID matches the &quot;1234&quot;&lt;/p&gt;

&lt;p&gt;The mongo.Pipeline is made up of&#160;&lt;br/&gt;
&#160;&lt;br/&gt;
matchStage := bson.D{primitive.E{Key: &quot;$match&quot;, Value: bson.D{primitive.E{Key: &quot;manufacturerID&quot;, Value: &quot;19193&quot;}}}}&lt;/p&gt;

&lt;p&gt;projectStage := bson.D{&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {&quot;$project&quot;, bson.D{&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {&quot;units&quot;, bson.D{&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;{&quot;$filter&quot;, bson.D&lt;/p&gt;
{
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;\{&quot;input&quot;, &quot;$units&quot;}
&lt;p&gt;,&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;{&quot;as&quot;, &quot;units&quot;},&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;{&quot;cond&quot;, bson.D{&lt;br/&gt;
{&quot;$or&quot;, bson.A{&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; bson.D{{&quot;$eq&quot;, bson.A&lt;/p&gt;
{&quot;$$units.assetsReserved.departmentCode&quot;, &quot;1234&quot;}
&lt;p&gt;}},&lt;br/&gt;
 bson.D{{&quot;$eq&quot;, bson.A&lt;/p&gt;
{&quot;$$units.assetsReserved.assets.primaryTrackingID&quot;, &quot;1234&quot;}
&lt;p&gt;}},&lt;br/&gt;
}},&lt;br/&gt;
 }},&lt;br/&gt;
 }},&lt;br/&gt;
 }},&lt;br/&gt;
 }},&lt;br/&gt;
 }&lt;br/&gt;
 unwindStage := bson.D&lt;/p&gt;
{
 \{&quot;$unwind&quot;, &quot;$units&quot;}
&lt;p&gt;,&lt;br/&gt;
 }&lt;/p&gt;

&lt;p&gt;The search based on&#160;&lt;/p&gt;

&lt;p&gt;units.assetsReserved.departmentCode works&lt;/p&gt;

&lt;p&gt;If we pass &quot;PHY_DEPTS&quot; we get the response, however&#160;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#FF0000&quot;&gt;&lt;b&gt;units.assetsReserved.assets.primaryTrackingID doesn&apos;t return any response&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#FF0000&quot;&gt;&lt;b&gt;If we pass &quot;1234&quot;&lt;/b&gt;&lt;/font&gt;&lt;br/&gt;
&#160;&lt;br/&gt;
&quot;$elemMatch&quot; works fine with assetsReserved.assets.primaryTrackingID and is able to return result however it returns only 1 record even when multiple records with same&#160;primaryTrackingID exists which is the expected behavior based on documentation.&lt;br/&gt;
Looks like issues with $filter and cond that its not able to filter when subdocument contains an array&#160;&lt;/p&gt;

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

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

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

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>Windows</environment>
        <key id="1402583">GODRIVER-1673</key>
            <summary>The Filter query on nested sub-document array is not returning results </summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="abhay.kumar1@pb.com">Abhay Kumar</reporter>
                        <labels>
                    </labels>
                <created>Tue, 7 Jul 2020 09:23:21 +0000</created>
                <updated>Wed, 8 Jul 2020 07:33:38 +0000</updated>
                            <resolved>Tue, 7 Jul 2020 14:33:58 +0000</resolved>
                                    <version>1.3.4</version>
                                                    <component>CRUD</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3273852" author="abhay.kumar1@pb.com" created="Wed, 8 Jul 2020 07:33:38 +0000"  >&lt;p&gt;I just updated the issues details if that help and posted above.&lt;/p&gt;</comment>
                            <comment id="3273850" author="abhay.kumar1@pb.com" created="Wed, 8 Jul 2020 07:33:01 +0000"  >&lt;p&gt;The data is stored as:&lt;/p&gt;

&lt;p&gt;{ &#160; &#160;&quot;_id&quot;:&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
{&quot;$oid&quot;:&quot;5e7b22bd2a7912a5a3b73d79&quot;}

&lt;p&gt;,&lt;br/&gt;
&#160; &#160;&quot;manufacturerID&quot;:&quot;19193&quot;,&lt;br/&gt;
&#160; &#160;&quot;units&quot;:[&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &quot;assetsReserved&quot;:{&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &quot;departmentCode&quot; : &quot;PHY_DEPTS&quot;,&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &quot;assets&quot;:{&quot;primaryID&quot;:&quot;1234&quot;}}&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; },&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;{&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&quot;departmentCode&quot; : &quot;PHY_DEPTS&quot;,&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &quot;assetsReserved&quot;:{&quot;assets&quot;:{&quot;primaryID&quot;:&quot;4567&quot;}}&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;}&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160;]&lt;br/&gt;
}&lt;br/&gt;
The requirement is to get all the units where primaryID matches the &quot;1234&quot;&lt;/p&gt;

&lt;p&gt;The mongo.Pipeline is made up of&#160;&lt;br/&gt;
&#160;&lt;br/&gt;
matchStage := bson.D{primitive.E{Key: &quot;$match&quot;, Value: bson.D{primitive.E{Key: &quot;manufacturerID&quot;, Value: &quot;19193&quot;}}}}&lt;/p&gt;

&lt;p&gt;projectStage := bson.D{&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {&quot;$project&quot;, bson.D{&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {&quot;units&quot;, bson.D{&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;{&quot;$filter&quot;, bson.D&lt;/p&gt;

&lt;p&gt;{ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
{&quot;input&quot;, &quot;$units&quot;}

&lt;p&gt;,&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;{&quot;as&quot;, &quot;units&quot;},&lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;{&quot;cond&quot;, bson.D{&lt;br/&gt;
{&quot;$or&quot;, bson.A{&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; bson.D{{&quot;$eq&quot;, bson.A&lt;/p&gt;

{&quot;$$units.assetsReserved.departmentCode&quot;, &quot;1234&quot;}

&lt;p&gt;}},&lt;br/&gt;
bson.D{{&quot;$eq&quot;, bson.A&lt;/p&gt;

{&quot;$$units.assetsReserved.assets.primaryID&quot;, &quot;1234&quot;}

&lt;p&gt;}},&lt;br/&gt;
}},&lt;br/&gt;
}},&lt;br/&gt;
}},&lt;br/&gt;
}},&lt;br/&gt;
}},&lt;br/&gt;
}&lt;br/&gt;
unwindStage := bson.D&lt;/p&gt;

&lt;p&gt;{ &lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
{&quot;$unwind&quot;, &quot;$units&quot;}

&lt;p&gt;,&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;The search based on&#160;&lt;/p&gt;

&lt;p&gt;units.assetsReserved.departmentCode works&lt;/p&gt;

&lt;p&gt;If we pass &quot;PHY_DEPTS&quot; we get the response, however&#160;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#ff0000&quot;&gt;&lt;b&gt;units.assetsReserved.assets.primaryID doesn&apos;t return any response&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#ff0000&quot;&gt;&lt;b&gt;If we pass &quot;1234&quot;&lt;/b&gt;&lt;/font&gt;&lt;br/&gt;
&#160;&lt;br/&gt;
&quot;$elemMatch&quot; works fine with assetsReserved.assets.primaryID and is able to return result however it returns only 1 record even when multiple records with same primaryID exists which is the expected behavior based on documentation.&lt;br/&gt;
Looks like issues with $filter and cond that its not able to filter when subdocument contains an array&#160;&lt;/p&gt;</comment>
                            <comment id="3273844" author="abhay.kumar1@pb.com" created="Wed, 8 Jul 2020 07:25:44 +0000"  >&lt;p&gt;How is it a support issue? The filtering query on array element withing a sub document is not returning results. I think it requires investigation on your side&#160;&lt;/p&gt;</comment>
                            <comment id="3272188" author="jeff.yemin" created="Tue, 7 Jul 2020 14:33:47 +0000"  >&lt;p&gt;Hi there, thank you for reaching out. As this sounds like a support issue, I wanted to give you some resources to get this questioned answered more quickly:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;our MongoDB support portal, located at &lt;a href=&quot;https://support.mongodb.com/welcome&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;support.mongodb.com&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;our MongoDB community portal, located &lt;a href=&quot;https://developer.mongodb.com/community/forums/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;&lt;br/&gt;
-If you are an Atlas customer, there is free support offered 24/7 in the lower right hand corner of the UI.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Just in case you have already opened a support case and are not receiving sufficient help, please let me know and I can facilitate escalating your issue.&lt;/p&gt;

&lt;p&gt;Thank you!&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|hxgjy7:</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>