get_nearest

ReQL command: get_nearest

Command syntax

table.get_nearest(point, {:index => 'indexname'[, :max_results => 100, :max_dist => 100000, :unit => 'm', :geo_system => 'WGS84']}) → array

Description

Return a list of documents closest to a specified point based on a geospatial index, sorted in order of increasing distance.

The index argument is mandatory. Optional arguments are:

  • max_results: the maximum number of results to return (default 100).
  • unit: Unit for the distance. Possible values are m (meter, the default), km (kilometer), mi (international mile), 登录查看完整内容