forked from mongodb/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiargs-dbcommand-geoNear-field.yaml
180 lines (165 loc) · 4.58 KB
/
apiargs-dbcommand-geoNear-field.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
arg_name: field
description: |
The collection to query.
interface: command
name: geoNear
operation: geoNear
optional: false
position: 1
type: string
---
arg_name: field
description: |
The point for which to find the closest documents.
If using a :doc:`2dsphere </core/2dsphere>` index, you can specify
the point as either a GeoJSON point or legacy coordinate pair.
If using a :doc:`2d </core/2d>` index, specify the point as a legacy
coordinate pair.
interface: command
name: near
operation: geoNear
optional: false
position: 2
type:
- GeoJSON point
- :term:`legacy coordinate pair <legacy coordinate pairs>`
---
arg_name: field
description: |
Required if using a ``2dsphere`` index. Determines how MongoDB
calculates the distance. The default value is ``false``.
If ``true``, then MongoDB uses spherical geometry to calculate
distances in meters if the specified (``near``) point is a GeoJSON
point and in radians if the specified (``near``) point is a legacy
coordinate pair.
If ``false``, then MongoDB uses 2d planar geometry to calculate
distance between points.
If using a :doc:`2dsphere </core/2dsphere>` index, ``spherical`` must
be ``true``.
interface: command
name: spherical
operation: geoNear
optional: false
position: 3
type: boolean
---
arg_name: field
description: |
The maximum number of documents to return. The default value is ``100``.
See also the ``num`` option.
interface: command
name: limit
operation: geoNear
optional: true
position: 4
type: number
---
arg_name: field
description: |
The ``num`` option provides the same function as the ``limit`` option.
Both define the maximum number of documents to return. If both options
are included, the ``num`` value overrides the ``limit`` value.
interface: command
name: num
operation: geoNear
optional: true
position: 5
type: number
---
arg_name: field
description: |
The minimum distance from the center point that the documents *must*
be. MongoDB filters the results to those documents that are *at
least* the specified distance from the center point.
Only available for use with :doc:`2dsphere </core/2dsphere>` index.
Specify the distance in meters for :term:`GeoJSON` data and in
radians for :term:`legacy coordinate pairs <legacy coordinate pairs>`.
.. versionadded:: 2.6
interface: command
name: minDistance
operation: geoNear
optional: true
position: 6
type: number
---
arg_name: field
description: |
The maximum distance from the center point that the documents *can*
be. MongoDB limits the results to those documents that fall within
the specified distance from the center point.
Specify the distance in meters for :term:`GeoJSON` data and in
radians for :term:`legacy coordinate pairs <legacy coordinate pairs>`.
interface: command
name: maxDistance
operation: geoNear
optional: true
position: 7
type: number
---
arg_name: field
description: |
Limits the results to the documents that match the query. The query
syntax is the usual MongoDB :ref:`read operation query
<read-operations-query-argument>` syntax.
.. include:: /includes/fact-geoNear-restrict-near-in-query.rst
interface: command
name: query
operation: geoNear
optional: true
position: 8
type: document
---
arg_name: field
description: |
The factor to multiply all distances returned by the query. For
example, use the ``distanceMultiplier`` to convert radians, as
returned by a spherical query, to kilometers by multiplying by the
radius of the Earth.
interface: command
name: distanceMultiplier
operation: geoNear
optional: true
position: 9
type: number
---
arg_name: field
description: |
If this is ``true``, the query
returns the location of the matching documents in the results. The
default is ``false``. This option is useful when a location field
contains multiple locations. To specify a field within an
embedded document, use :term:`dot notation`.
interface: command
name: includeLocs
operation: geoNear
optional: true
position: 10
type: boolean
---
arg_name: field
description: |
If this value is ``true``, the query returns a matching document once,
even if more than one of the document's location fields match the
query.
.. include:: /includes/deprecation-uniqueDocs.rst
interface: command
name: uniqueDocs
operation: geoNear
optional: true
position: 11
type: boolean
---
name: readConcern
position: 12
type: document
description: |
Specifies the :term:`read concern`. The option has the following
syntax:
.. code-block:: javascript
readConcern: { level: <value> }
.. include:: /includes/fact-readConcern-option-description.rst
optional: true
operation: geoNear
arg_name: field
interface: dbcommand
...