I have been using sails.js on a project which will show posts near a users location, however while I have had no trouble in finding references and tools to geocode an address I cannot find any information on finding these by distance from another set of coordinates, the way you would using regular mongodb. my places model is:
module.exports = {
attributes: {
longitude: {
type: 'float',
required: true
},
latitude: {
type: 'float'
},
country: {
type: 'string'
},
city: {
type: 'string'
},
stateCode: {
type: 'string'
},
zipcode: {
type: 'string'
},
streetName: {
type: 'string'
},
streetNumber: {
type: 'string'
}
}
};
How would i compose a find of this model in order to find and sort by distance within a set range?