Geo Lat/Lon Queries in Mongo

First off, great job with Metabase. This is a really helpful product! Thanks for building it.

I’m trying to use the State and Pin views for our data but our geo data is formatted differently than what is currently required by MB.

Using Mongodb, we store geo data like so:

{
location: [37.323452809724266, -121.76920053197229],
...
}

And I believe MB is looking for something like:

{
latitude: 37.323452809724266,
longitude: -121.76920053197229,
...
}

Without running an entire db migration to reformat our location data, is there a way to tell MB what our geo data style is so that it will work properly?

We’re still struggling with a natural way to deal with arrays in general to be honest. We’ve discussed composite fields (eg, finding tables with clear lat/long pairs and treating them as pairs) and this would be a good place to use the idea. Mind filing an issue as I think this is something we can put in the product vs forcing you to do a projection or reformatting?

1 Like

Opened issue here: https://github.com/metabase/metabase/issues/1331