Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8542045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:58:10+00:00 2026-06-11T11:58:10+00:00

I am trying to perform a bounding box query on a mongo db collection.

  • 0

I am trying to perform a bounding box query on a mongo db collection. The collection has been there for quite a while and I recently upgraded my driver from 1.3 to 1.6 to take advantage of some new features in Mongodb 2.2. The following query doesn’t work:

var query = Query<TrafficUpdate>.WithinRectangle(x => x.Loc, lowerLeft.Lon, lowerLeft.Lat, upperRight.Lon, upperRight.Lat);

The above line doesnt work anymore though. Comes back with an error about “cannot find special index 2d for …..”

Any help would be appreciated.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:58:11+00:00Added an answer on June 11, 2026 at 11:58 am

    Just found the answer actually. There must be a bug in the driver. Property Loc should be automapped as “loc” in the collection. This works just fine when writing to or reading from the db. But in the case of the WithinRectangle query (same for .Near query) it throws the error mentioned above.

    The answer is to explicitly map the property in the configuration:

    cm.MapProperty(c => c.Loc).SetElementName("loc");`
    

    Maybe this will help some people.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to perform a DISTINCT clause on a query like this SELECT DISTINCT
I am trying to perform a update/insert into query for MySQL. Should insert, if
I'm trying to perform a query for the number of records where the 11th
I'm trying to perform a complex issue, I have a query structured like this:
I'm trying to perform the following query in LLBL and I'm not having much
I am currently trying to perform an LDAP query in c++ to get the
I'm trying to perform a post query when the user leaves the page. The
I am trying to perform a simple query, but Datamapper does not seem to
I am trying to perform a query which is composed of two $or 's:
I'm trying to perform different actions on a value placed in an input box

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.