showing results for - "mongoose find near location"
Dan
27 Jul 2020
1const citySchema = new mongoose.Schema({
2  name: String,
3  location: {
4    type: {
5      type: String, // Don't do `{ location: { type: String } }`
6      enum: ['Point'], // 'location.type' must be 'Point'
7      required: true
8    },
9    coordinates: {
10      type: [Number],
11      required: true
12    }
13  }
14});
Jordon
10 Apr 2017
1CityModel.find().where('location').near({center: coords, maxDistance: 500})
Fabian
04 Aug 2020
1var locQuery = (coords, distance) => {
2    return { loc: { $near: { $geometry: { type: "Point", coordinates: coords }, $maxDistance: parseInt(distance)}}}
3}
queries leading to this page
lat and lon in mongoose schemamongoose locationmongoose point typemongoose pointlocation geo mongoosecoordinates schema mongodbmongoose schema geojsonmongoose reformat geojson to lat longschema for latitude and longitude of location in mongoosemongoose search query by latitude and longitudemongoose geojson 5blong 2c lat 5d mongoosemongoose update location coordinatesmongoose find geojsonmongoose store google maps city locationgeojson mongoose 27mongodb geojsongeojson point mongooseadd geojson in mongodb using mongoosemongoose latitude typemongodb location schemafind by place mongoosehow to find geopoints radius in mongoosegeocode mongoosegeojson point schema in mongoosemongoose schema types multipolygongeojson mongoosegeojson detec location nodejs mongodbmongoose geo jsonmongoose placemongoose model data type coordinatesgeospecial type mongoosemongoose geojson withinmongoose radius searchmongoose coordinates latitude and longitudemoongoose geo jso mgeo json in mongoosemongodb point schematype lat long mongoose schemamongoose geopoingmongoose model locationmongoose geolocation querygeojson mongoose schemamongoose find near locationmongoose geosearchmongoose location object2dsphere schema in mongoosemongodb schema for coordinatesmongoose location object find by distancemongoos geo querymongoose geojson featurelocation type in mongoosehow to get area in map from database mongoosemongoose geolocationmongoose schema types polygon or multipolygongeoquery find mongoose pointmongoose schema coordinatesschema locationmongoose nodejs mongoose geojsonmongoose 24nearmongoose geo queryhow to store coordinates in mongoosemongoose how to store coordonnatessaving geojson data in mongoosehow to create a location index for mongodb on mongoosegeolocation mongo schemamongoose geojson queryhow to do do mongoose schema for location with lat lngdata type latitude longitude mongoosegeojson mongoose mapquestlongitude latitude coordinates mongoosemongoose geojson feature schemamongoose geojsonmongoose query by geo directiongeojson mongoose nearmongoose model cordinatesmongoose geojsomongoose geojson vs lat longmoogose geolocationmongoose geomongoose update location coordinatemongoose schema location typemongoose geojasonmongoose geospatialpolygon mongoosemongoose point schemageojson schema mongoosepoint data type mongoose schemamongoose coordinatesgeospatial queries mongoosenear mongoosemongoose find near location