Sun Chanras
Sun Chanras

Reputation: 49

How to do ArangoDB geo index for multiple location[lat,lon]

I tried to do Geo Index for a job post platform. I have a job post object which could have multiple locations[lat,lon]. I've read and tried everything on the official documents but I can only do GeoIndex with one location. https://www.arangodb.com/docs/stable/indexing-geo.html#multipoint https://www.arangodb.com/docs/stable/aql/functions-geo.html#geo_distance

I want to do Geo index on locations[lat,lon] field with multiple lat and lon values.

Please help

Upvotes: 0

Views: 62

Answers (1)

LFNL
LFNL

Reputation: 21

If you have a list of locations you can set up an array-index.

collection.ensureIndex({ type: "geo", fields: [ "locations[*]" ], geoJson:true })

Upvotes: 1

Related Questions