<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:02:40 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-3297] Bounding box queries in embedded geo documents (Mongo v1.9) not working properly</title>
                <link>https://jira.mongodb.org/browse/SERVER-3297</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Bounding box queries inside the embedded documents are giving inaccurate results. Sample document&lt;/p&gt;

&lt;p&gt;&quot;_id&quot; : ObjectId(&quot;4dff052e1d41c8588000000a&quot;),&lt;br/&gt;
	&quot;isused&quot; : true,&lt;br/&gt;
	&quot;isfixed&quot; : true,&lt;br/&gt;
	&quot;kind&quot; : 0,&lt;br/&gt;
	&quot;name&quot; : &quot;Used whirlpool refrigirator wanted&quot;,&lt;br/&gt;
	&quot;desc&quot; : &quot;2 years used 200 litres Whirlpool refrigerator is for sale.&quot;,&lt;br/&gt;
	&quot;price&quot; : 5000,&lt;br/&gt;
         	&quot;locations&quot; : [&lt;br/&gt;
		&lt;/p&gt;
{
			&quot;name&quot; : &quot;Samiyar Madam, Kodambakkam, Chennai, Tamil Nadu, India&quot;,
			&quot;loc&quot; : [
				80.22167450000006,
				13.0454044
			],
			&quot;is_exact&quot; : true,
			&quot;kind&quot; : &quot;neighborhood&quot;,
			&quot;_id&quot; : ObjectId(&quot;4dff052e1d41c8588000000b&quot;)
		}
&lt;p&gt;,&lt;br/&gt;
		&lt;/p&gt;
{
			&quot;_id&quot; : ObjectId(&quot;4dff052e1d41c8588000000c&quot;),
			&quot;kind&quot; : &quot;route&quot;,
			&quot;name&quot; : &quot;Shiyamala Vadhana St, Samiyar Madam, Kodambakkam, Chennai, Tamil Nadu, India&quot;,
			&quot;loc&quot; : [
				80.2216906,
				13.0452927
			]
		}
&lt;p&gt;,&lt;br/&gt;
		&lt;/p&gt;
{
			&quot;_id&quot; : ObjectId(&quot;4dff052e1d41c8588000000d&quot;),
			&quot;kind&quot; : &quot;sublocality&quot;,
			&quot;name&quot; : &quot;Kodambakkam, Chennai, Tamil Nadu, India&quot;,
			&quot;loc&quot; : [
				80.223766,
				13.049043
			]
		}
&lt;p&gt;,&lt;br/&gt;
             }]&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;when issuing the $box query with this co-ordinates [&lt;span class=&quot;error&quot;&gt;&amp;#91;80.21758681346137, 13.04706625300893&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;80.2238953690644, 13.052333939665253&amp;#93;&lt;/span&gt;], it should not pick the above item&lt;/p&gt;

&lt;p&gt;db.items.find({&quot;locations.is_exact&quot;:true,&quot;locations.loc&quot; : {&quot;$within&quot; : &lt;/p&gt;
{&quot;$box&quot; :[[80.21758681346137, 13.04706625300893], [80.2238953690644, 13.052333939665253]]  }
&lt;p&gt; }})&lt;/p&gt;

&lt;p&gt;But this query picks the above item.&lt;/p&gt;

&lt;p&gt;So i created another document(not embedded) with the same data &amp;amp; location. like this&lt;/p&gt;

&lt;p&gt;  &quot;_id&quot; : ObjectId(&quot;4dff052e1d41c8588000000a&quot;),&lt;br/&gt;
	&quot;isused&quot; : true,&lt;br/&gt;
	&quot;isfixed&quot; : true,&lt;br/&gt;
	&quot;kind&quot; : 0,&lt;br/&gt;
	&quot;name&quot; : &quot;Used whirlpool refrigirator wanted&quot;,&lt;br/&gt;
	&quot;desc&quot; : &quot;2 years used 200 litres Whirlpool refrigerator is for sale.&quot;,&lt;br/&gt;
	&quot;price&quot; : 5000,&lt;br/&gt;
        &quot;loc&quot; : [&lt;br/&gt;
				80.22167450000006,&lt;br/&gt;
				13.0454044&lt;br/&gt;
		  ]&lt;/p&gt;

&lt;p&gt;and used the same box query&lt;/p&gt;

&lt;p&gt;db.items.find({loc : {&quot;$within&quot; : &lt;/p&gt;
{&quot;$box&quot; :[[80.21758681346137, 13.04706625300893], [80.2238953690644, 13.052333939665253]]  }
&lt;p&gt; }})&lt;/p&gt;

&lt;p&gt;now it works fine. it doesn&apos;t pick up the item. So this problem only exists in v1.9 geo indexes in embedded documents&lt;/p&gt;</description>
                <environment>Platform independent</environment>
        <key id="18483">SERVER-3297</key>
            <summary>Bounding box queries in embedded geo documents (Mongo v1.9) not working properly</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="greg_10gen">Greg Studer</assignee>
                                    <reporter username="rameshvel">ramesh vel</reporter>
                        <labels>
                            <label>geo</label>
                            <label>indexing</label>
                            <label>query</label>
                    </labels>
                <created>Mon, 20 Jun 2011 09:12:38 +0000</created>
                <updated>Fri, 30 Mar 2012 14:26:46 +0000</updated>
                            <resolved>Tue, 21 Jun 2011 19:40:30 +0000</resolved>
                                    <version>1.9.0</version>
                                                    <component>Geo</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="39037" author="rameshvel" created="Fri, 24 Jun 2011 08:16:10 +0000"  >&lt;p&gt;Greg, &lt;br/&gt;
      thanks for the clarification.  Now its clear to me. sure i ll vote for the feature.&lt;/p&gt;
</comment>
                            <comment id="39025" author="greg_10gen" created="Fri, 24 Jun 2011 04:18:26 +0000"  >&lt;p&gt;I don&apos;t mean to offend you or minimize your issue, we just tend to be concise.&lt;/p&gt;

&lt;p&gt;If you have a coll with a non-geo document like:&lt;br/&gt;
{ loc : [ &lt;/p&gt;
{ is_exact : true, loc : 0 }
&lt;p&gt;, &lt;/p&gt;
{ is_exact : false, loc : 1 }
&lt;p&gt; ] }&lt;/p&gt;

&lt;p&gt;and you search for:&lt;br/&gt;
db.coll.find(&lt;/p&gt;
{ &quot;loc.is_exact&quot; : true, &quot;loc.loc&quot; : 1 }
&lt;p&gt;)&lt;br/&gt;
you&apos;ll get back the document, the match applies to the entire document, not the sub-documents separately :&lt;br/&gt;
{ loc : [ &lt;/p&gt;
{ is_exact : true, loc : 0 }
&lt;p&gt;, &lt;/p&gt;
{ is_exact : false, loc : 1 }
&lt;p&gt; ] }&lt;/p&gt;

&lt;p&gt;In order to do individual subdocument matching, you need to use the $elemMatch operator:&lt;br/&gt;
db.coll.find({ loc : { $elemMatch : &lt;/p&gt;
{ is_exact : true, loc : 1 }
&lt;p&gt; } })&lt;/p&gt;

&lt;p&gt;This operator isn&apos;t yet supported by geospatial queries - I&apos;ve created an improvement ticket that you can vote on if you think it should be:&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3325&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-3325&lt;/a&gt;&lt;/p&gt;




</comment>
                            <comment id="38645" author="rameshvel" created="Wed, 22 Jun 2011 04:21:20 +0000"  >&lt;p&gt;Greg Studer,&lt;br/&gt;
      No its not working correctly. If you look at the query correctly i have used one more filter &quot;locations.is_exact&quot; : true.&lt;/p&gt;

&lt;p&gt;db.items.find({&quot;locations.is_exact&quot;:true,&quot;locations.loc&quot; : {&quot;$within&quot; : &lt;/p&gt;
{&quot;$box&quot; :[[80.21758681346137, 13.04706625300893], [80.2238953690644, 13.052333939665253]] }
&lt;p&gt; }})&lt;/p&gt;

&lt;p&gt;So the query must  look only into the first embedded document &lt;/p&gt;

&lt;p&gt;&quot;name&quot; : &quot;Samiyar Madam, Kodambakkam, Chennai, Tamil Nadu, India&quot;,&lt;br/&gt;
&quot;loc&quot; : [&lt;br/&gt;
80.22167450000006,&lt;br/&gt;
13.0454044&lt;br/&gt;
],&lt;br/&gt;
&quot;is_exact&quot; : true,&lt;br/&gt;
&quot;kind&quot; : &quot;neighborhood&quot;,&lt;br/&gt;
&quot;_id&quot; : ObjectId(&quot;4dff052e1d41c8588000000b&quot;)&lt;br/&gt;
},&lt;/p&gt;

&lt;p&gt;not the one you have mentioned  [ 80.223766, 13.049043 ] one.&lt;/p&gt;


&lt;p&gt;{&lt;br/&gt;
&quot;_id&quot; : ObjectId(&quot;4dff052e1d41c8588000000d&quot;),&lt;br/&gt;
&quot;kind&quot; : &quot;sublocality&quot;,&lt;br/&gt;
&quot;name&quot; : &quot;Kodambakkam, Chennai, Tamil Nadu, India&quot;,&lt;br/&gt;
&quot;loc&quot; : [&lt;br/&gt;
80.223766,&lt;br/&gt;
13.049043&lt;br/&gt;
]&lt;br/&gt;
},&lt;/p&gt;


&lt;p&gt;Also, if it works perfectly, it should work in both normal &amp;amp; embedded documents. But its not. So its an issue.&lt;/p&gt;

&lt;p&gt;So please re-open the issue, its a important one.&lt;/p&gt;</comment>
                            <comment id="38578" author="greg_10gen" created="Tue, 21 Jun 2011 19:40:30 +0000"  >&lt;p&gt;Think this is working properly?  The third point:&lt;/p&gt;

&lt;p&gt;[ 80.223766, 13.049043 ]&lt;/p&gt;

&lt;p&gt;is inside the box:&lt;/p&gt;

&lt;p&gt;[&lt;span class=&quot;error&quot;&gt;&amp;#91;80.21758681346137, 13.04706625300893&amp;#93;&lt;/span&gt;, &lt;span class=&quot;error&quot;&gt;&amp;#91;80.2238953690644, 13.052333939665253&amp;#93;&lt;/span&gt;]&lt;/p&gt;

&lt;p&gt;I&apos;m guessing you&apos;re trying to search for documents with &lt;b&gt;all&lt;/b&gt; points within a region? - $within queries find documents with &lt;b&gt;any&lt;/b&gt; points inside a region, right now there&apos;s no automatic way to get those results, you&apos;d have to filter them on the client side.  If this is what you were expecting and it&apos;s important for your use case, I&apos;d recommend creating (a different) improvement JIRA case.&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>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 21 Jun 2011 19:40:30 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 34 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10020"><![CDATA[Linux]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>greg_10gen</customfieldvalue>
            <customfieldvalue>rameshvel</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hroxfj:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>23130</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|ht0c0f:</customfieldvalue>

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