GeoNear constructor

GeoNear({
  1. required Geometry near,
  2. required String distanceField,
  3. num? maxDistance,
  4. num? minDistance,
  5. bool? spherical,
  6. dynamic query,
  7. num? distanceMultiplier,
  8. String? includeLocs,
  9. String? key,
})

Implementation

GeoNear(
    {required Geometry near,
    required String distanceField,
    num? maxDistance,
    num? minDistance,
    bool? spherical,
    dynamic query,
    num? distanceMultiplier,
    String? includeLocs,
    String? key})
    : assert(near.type == GeometryObjectType.Point,
          '\$geoNear \'near\' field must be Point'),
      super(
          'geoNear',
          AEObject({
            'near': near.build()[r'$geometry'],
            'distanceField': distanceField,
            if (maxDistance != null) 'maxDistance': maxDistance,
            if (minDistance != null) 'minDistance': minDistance,
            if (spherical != null) 'spherical': spherical,
            if (query != null) 'query': _getQuery(query),
            if (distanceMultiplier != distanceMultiplier)
              'distanceMultiplier': distanceMultiplier,
            if (includeLocs != null) 'includeLocs': includeLocs,
            if (key != null) 'key': key
          }));