Problem using a new Type that has a GeoJSON index

I created a type with a GeoJSON property as an index.  I get an error when I try to add a record, saying that the format of the GeoJSON is not correct.

Error 2020-07-29T21:13:24.572Z

HTTP Status 400 () (while running INSERT query):

com.accessg2.ag2rs.mongo.error: Op insert encountered MongoDB exception: location object expected, location array not in correct format

Has anyone seen this?  Is this by design?

Posted: July 29, 2020 at 9:55 pm
Replies: 4
Jul 29, 2020
Posted by Ken

I have not seen this. Unless you selected “GeoJSON 2D-plane” for your index. Can you show us what you are using for an index?

Your index should be set to “GeoJSON 2D-sphere”

The other thing you want to make sure is that you define your GeoJSON like:

geometry: { 
        type: "Point", 
        coordinates: [ 90.834, 34.1987 ] 

Notice the ‘P’ in Point is capitalized.

The lowercase ‘p’ will not work.

Jul 29, 2020
Posted by dsprinzen

I selected “2D-plane” for the index.

But I was inserting using the “+Add Record” from the Type property window.  Shouldn’t that work?

Jul 29, 2020
Posted by Ken

To the best of my knowledge it’s not possible to use 2D-plane anymore.

So I would use 2D-sphere as your index.

Jul 29, 2020
Posted by dsprinzen

Thank you.  2D-sphere worked.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
© Vantiq 2024 All rights reserved  •  Vantiq Corporation’s Privacy Policy and Cookie Policy