Mongoosastic, how can i make an Geo Distance Query Mongoosastic, how can i make an Geo Distance Query mongoose mongoose

Mongoosastic, how can i make an Geo Distance Query


Thank you Paradise228, it was the mapping.

this work:

...geo_with_lat_lon: {        geo_point: {            es_indexed: true,            type: String,            es_type: 'geo_point',            es_lat_lon: true        },        lat: {type: Number},        lon: {type: Number}    },...

with this mapping:

global.DBModel.store.createMapping(function (err, mapping) {    if (err) {        console.log('error creating mapping (you can safely ignore this)');        console.log(err);    } else {        console.log('mapping created!');        console.log(mapping);    }});