<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:05:20 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-4221] Working with a large set of geospatial data but is there no way around &quot;can&apos;t have 2 special fields&quot;?</title>
                <link>https://jira.mongodb.org/browse/SERVER-4221</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;My team is working on a product that involves a very large set of geospatial data and initially thought Mongo might be the right choice for us. However it seems there&apos;s an inherit limitation with GeoPointFields. Is there no way to work around the 2 special fields limitation? It&apos;s critical that we are able to filter by at least two geopoint fields in a single query. If this isn&apos;t possible at all in Mongo this may not be the right tool for us.&lt;/p&gt;</description>
                <environment>Linux</environment>
        <key id="24544">SERVER-4221</key>
            <summary>Working with a large set of geospatial data but is there no way around &quot;can&apos;t have 2 special fields&quot;?</summary>
                <type id="6" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14720&amp;avatarType=issuetype">Question</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="3">Duplicate</resolution>
                                        <assignee username="greg_10gen">Greg Studer</assignee>
                                    <reporter username="maxcountryman">Max Countryman</reporter>
                        <labels>
                            <label>query</label>
                    </labels>
                <created>Sun, 6 Nov 2011 11:41:29 +0000</created>
                <updated>Tue, 29 Mar 2016 06:56:33 +0000</updated>
                            <resolved>Wed, 16 Nov 2011 18:00:12 +0000</resolved>
                                                                    <component>Geo</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1217657" author="shibish" created="Tue, 29 Mar 2016 06:56:33 +0000"  >&lt;p&gt;i need to calculate the distance from start to destination how to do a query in mongo...     &quot;distance&quot; : 0.0079,&lt;br/&gt;
    &quot;free_record&quot; : &quot;&quot;,&lt;br/&gt;
    &quot;loc&quot; : &lt;/p&gt;
{
        &quot;type&quot; : &quot;LineString&quot;,
        &quot;coordinates&quot; : [ 
            [ 
                11.0214407, 
                76.9165522
            ], 
            [ 
                11.0214407, 
                76.9165522
            ], 
            [ 
                11.0214409, 
                76.9165544
            ], 
            [ 
                11.0214429, 
                76.9165543
            ], 
            [ 
                11.0214428, 
                76.9165556
            ], 
            [ 
                11.0214429, 
                76.9165562
            ], 
            [ 
                11.0214432, 
                76.916555
            ], 
            [ 
                11.0214427, 
                76.9165549
            ], 
            [ 
                11.0214443, 
                76.9165546
            ], 
            [ 
                11.0214439, 
                76.9165545
            ], 
            [ 
                11.0214435, 
                76.9165544
            ]
]
}
&lt;p&gt; pls give a query to calculate the distance&lt;/p&gt;</comment>
                            <comment id="65258" author="greg_10gen" created="Mon, 7 Nov 2011 20:50:52 +0000"  >&lt;p&gt;Right, multiple geospatial fields aren&apos;t currently supported - you can work around this currently with two collections and using an $in query :&lt;/p&gt;

&lt;p&gt;var origin_route_ids = db.origins.find({ pos : { $within : &lt;/p&gt;
{ &amp;lt;origin&amp;gt; }
&lt;p&gt; } }, &lt;/p&gt;
{ route_id : 1 }
&lt;p&gt;).toArray()&lt;br/&gt;
var dest_route_ids = db.dests.find({ pos  : { $within : &lt;/p&gt;
{ &amp;lt;destination&amp;gt; }
&lt;p&gt; }, route_id : &lt;/p&gt;
{ $in : origin_route_ids }
&lt;p&gt; }, &lt;/p&gt;
{ route_id : 1 }
&lt;p&gt;).toArray()&lt;br/&gt;
return db.routes.find(&lt;/p&gt;
{ route_id : dest_route_ids }
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;The downside is of course that you&apos;ll have to pull the _ids back to the app in the meantime - these will probably be pretty small, but there could be many.  Again, this should be supported as a single query using aggregation operators in the future, but the algorithm will effectively be the same.  It&apos;s something we&apos;re working on.&lt;/p&gt;

&lt;p&gt;There&apos;s probably a way to do this as a single query using the $where operator and checking distance via javascript, but the overhead is probably not be worth it for large data sets.&lt;/p&gt;</comment>
                            <comment id="65222" author="maxcountryman" created="Mon, 7 Nov 2011 18:54:25 +0000"  >&lt;p&gt;For instance, say we have a Route document, containing both an origin and a destination as GeoPointFields. We want to be able to filter within a given distance on both the origin and the destination in a single query. It seems there&apos;s a limit on filtering by special fields, &quot;can&apos;t have 2 special fields&quot;, which is getting in the way of doing this as a single query.&lt;/p&gt;</comment>
                            <comment id="65210" author="greg_10gen" created="Mon, 7 Nov 2011 18:29:58 +0000"  >&lt;p&gt;Not sure I know exactly what you mean, but if you&apos;re referring to the ability to do something like :&lt;/p&gt;

&lt;p&gt;db.coll.find({ posA : { $within : &lt;/p&gt;
{ $center [...] }
&lt;p&gt; }, posB : { $within : &lt;/p&gt;
{ $polygon : [...] }
&lt;p&gt; } }), there isn&apos;t currently direct support for intersections/unions like this - you&apos;d have to join the shapes yourself and search there.  The new aggregation framework we&apos;re releasing should allow this, but the query would still work by first searching one region, then filtering all those results by the second region.&lt;/p&gt;

&lt;p&gt;If you have documents that incorporate multiple locations, you can embed them in nested subdocuments, like :&lt;/p&gt;

&lt;p&gt;{ positions : [ &lt;/p&gt;
{ pos : [ ... ] }
&lt;p&gt;, &lt;/p&gt;
{ pos : [ ... ] }
&lt;p&gt;, &lt;/p&gt;
{ pos : [ ... ] }
&lt;p&gt; ] }&lt;br/&gt;
db.ensureIndex(&lt;/p&gt;
{ &quot;positions.pos&quot; : &quot;2d&quot; }
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;then you can query for all documents with &lt;b&gt;any&lt;/b&gt; position inside a region, or find the nearest point (or points) in the document to another location (x,y).&lt;/p&gt;

&lt;p&gt;Can you give more info about what kind of queries you&apos;re looking to run?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="21217">SERVER-3653</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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>Mon, 7 Nov 2011 18:29:58 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 46 weeks, 1 day 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>shibish</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 46 weeks, 1 day 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>greg_10gen</customfieldvalue>
            <customfieldvalue>maxcountryman</customfieldvalue>
            <customfieldvalue>shibish</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrombz:</customfieldvalue>

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

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

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