Working with MongoDB 2dsphere to store GEOJSON and in some lat / lng stores. I keep getting the following error:
{ "code": 16755, "index": 0, "errmsg": "Can't extract geo keys: { _id: ObjectId('586ff135b79aa00b84181bfb'), name: \"Austin\", slug: \"Austin\", description: \"\", twitter: \"\", facebook: \"\", instagram: \"\", author: ObjectId('57b60fed8620b56af460d5c5'), tags: [], created: new Date(1483731253640), location: { address: \"Austin, TX, United States\", coordinates: [ 30.267153, -97.74306079999997 ], type: \"Point\" }, __v: 0 } longitude/latitude is out of bounds, lng: 30.2672 lat: -97.7431", "op": { "name": "Austin", "slug": "Austin", "description": "", "twitter": "", "facebook": "", "instagram": "", "author": "57b60fed8620b56af460d5c5", "_id": "586ff135b79aa00b84181bfb", "tags": [ ], "created": "2017-01-06T19:34:13.640Z", "location": { "address": "Austin, TX, United States", "coordinates": [ 30.267153, -97.74306079999997 ], "type": "Point" }, "__v": 0 } }
I can't understand why he doesn't like lat / lng coordinates.
Here is my diagram for the location field:
location: { type: { type: String, default: 'Point' }, coordinates: [Number], address: String },
and indexed as 2dsphere :
storeSchema.index({ location: '2dsphere' });
The only thing I see is the error message:
longitude/latitude is out of bounds, lng: 30.2672 lat: -97.7431",
lat / lng are shortened from what I entered - not sure if this has anything to do with it.