Exemple #1
0
 /// <summary>
 /// Adds a proximity-based constraint for finding objects with keys whose GeoPoint
 /// values are near the given point and within the maximum distance given.
 /// </summary>
 /// <param name="key">The key that the AVGeoPoint is stored in.</param>
 /// <param name="point">The reference AVGeoPoint.</param>
 /// <param name="maxDistance">The maximum distance (in radians) of results to return.</param>
 /// <returns>A new query with the additional constraint.</returns>
 public AVQuery <T> WhereWithinDistance(
     string key, AVGeoPoint point, AVGeoDistance maxDistance)
 {
     return(new AVQuery <T>(WhereNear(key, point), where : new Dictionary <string, object> {
         { key, new Dictionary <string, object> {
               { "$maxDistance", maxDistance.Radians }
           } }
     }));
 }
Exemple #2
0
        /// <summary>
        /// Adds a proximity-based constraint for finding objects with keys whose GeoPoint
        /// values are near the given point and within the maximum distance given.
        /// </summary>
        /// <param name="key">The key that the AVGeoPoint is stored in.</param>
        /// <param name="point">The reference AVGeoPoint.</param>
        /// <param name="maxDistance">The maximum distance (in radians) of results to return.</param>
        /// <returns>A new query with the additional constraint.</returns>
        public virtual S WhereWithinDistance(
            string key, AVGeoPoint point, AVGeoDistance maxDistance)
        {
            S avQuery = this.WhereNear(key, point);

            return(CreateInstance(avQuery, where : new Dictionary <string, object> {
                { key, new Dictionary <string, object> {
                      { "$maxDistance", maxDistance.Radians }
                  } }
            }));
        }