Skip to content

minor edits to the toc yaml and uniqueDoc operator #920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/includes/ref-toc-operator-projection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Projects the first element in an array that matches the query cond
---
name: ":projection:`$elemMatch`"
file: /reference/projection/elemMatch
description: "Projects only elements from an array that match the specified query condition."
description: "Projects only the first element from an array that matches the specified :projection:`$elemMatch` condition."
---
name: ":projection:`$slice`"
file: /reference/projection/slice
Expand Down
2 changes: 1 addition & 1 deletion source/includes/ref-toc-operator-query-array.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ":operator:`$elemMatch`"
file: /reference/operator/elemMatch
description: "Selects documents if element in an array that match the specified query clause."
description: "Selects documents if element in the array field matches all the specified :operator:`$elemMatch` condition."
---
name: ":operator:`$size`"
file: /reference/operator/size
Expand Down
10 changes: 5 additions & 5 deletions source/includes/ref-toc-operator-query-comparison.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ description: "Matches arrays that contain all elements specified in the query."
---
name: ":operator:`$gt`"
file: /reference/operator/gt
description: "Matches values that are larger than the value specified in the query."
description: "Matches values that are greater than the value specified in the query."
---
name: ":operator:`$gte`"
file: /reference/operator/gte
description: "Matches values that are equal to or larger than the value specified in the query."
description: "Matches values that are equal to or greater than the value specified in the query."
---
name: ":operator:`$in`"
file: /reference/operator/in
description: "Matches any of the values that exist in an array specified to the query."
description: "Matches any of the values that exist in an array specified in the query."
---
name: ":operator:`$lt`"
file: /reference/operator/lt
description: "Matches vales that are smaller than the value specified in the query."
description: "Matches vales that are less than the value specified in the query."
---
name: ":operator:`$lte`"
file: /reference/operator/lte
description: "Matches values that are smaller or equal to the value specified in the query."
description: "Matches values that are less than or equal to the value specified in the query."
---
name: ":operator:`$ne`"
file: /reference/operator/ne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: "Specifies a circle using legacy coordinate pairs to :operator:`$ge
---
name: ":operator:`$centerSphere`"
file: /reference/operator/centerSphere
description: "Specifies a circle using legacy coordinate pairs for :operator:`$geoWithin` queries when using spherical geometry."
description: "Specifies a circle using either legacy coordinate pairs or :term:`GeoJSON` format for :operator:`$geoWithin` queries when using spherical geometry."
---
name: ":operator:`$box`"
file: /reference/operator/box
Expand All @@ -24,5 +24,5 @@ description: "Specifies a polygon to using legacy coordinate pairs for :operator
---
name: ":operator:`$uniqueDocs`"
file: /reference/operator/uniqueDocs
description: "Modifies a geospatial query using a ``2d`` index to ensure that a query will only return a single document once."
description: "Modifies a :operator:`$geoWithin` and :operator:`$near` queries to ensure that even if a document matches the query multiple times, the query returns the document once."
...
4 changes: 2 additions & 2 deletions source/includes/ref-toc-operator-query-geospatial.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: ":operator:`$geoWithin`"
file: /reference/operator/geoWithin
description: "Selects geometries within a bounding polygon."
description: "Selects geometries within a bounding :term:`GeoJSON` shape."
---
name: ":operator:`$geoIntersects`"
file: /reference/operator/geoIntersects
description: "Selects geometries that intersect with a polygon."
description: "Selects geometries that intersect with a :term:`GeoJSON` shape."
---
name: ":operator:`$near`"
file: /reference/operator/near
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ":operator:`$each`"
file: /reference/operator/each
description: "Modifies the :operator:`$push` and :operator:`$addToSet` operators to specify multiple items for array updates. "
description: "Modifies the :operator:`$push` and :operator:`$addToSet` operators to append multiple items for array updates."
---
name: ":operator:`$slice`"
file: /reference/operator/slice
Expand Down
4 changes: 2 additions & 2 deletions source/includes/ref-toc-operator-update-array.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ":operator:`$`"
file: /reference/operator/positional
description: "Updates an element of an array selected in the query, referenced by position in the array."
description: "Acts as a placeholder to update the first element that matches the query condition in an update."
---
name: ":operator:`$addToSet`"
file: /reference/operator/addToSet
Expand All @@ -20,7 +20,7 @@ description: "Removes items from an array that match a query statement."
---
name: ":operator:`$pushAll`"
file: /reference/operator/pushAll
description: "Deprecated. Adds several items to an array."
description: "*Deprecated.* Adds several items to an array."
---
name: ":operator:`$push`"
file: /reference/operator/push
Expand Down
2 changes: 1 addition & 1 deletion source/includes/ref-toc-operator-update-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "Renames a field."
---
name: ":operator:`$setOnInsert`"
file: /reference/operator/setOnInsert
description: "Sets the value of a field upon documentation creation. Has no effect on update operations that modify existing documents."
description: "Sets the value of a field upon documentation creation during an upsert. Has no effect on update operations that modify existing documents."
---
name: ":operator:`$set`"
file: /reference/operator/set
Expand Down
6 changes: 3 additions & 3 deletions source/reference/operator/uniqueDocs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $uniqueDocs
contains multiple coordinate values.

You can use :operator:`$uniqueDocs` only with the
:operator:`$geoWithin` and :operator:`$geoWithin` operators. The
:operator:`$geoWithin` and :operator:`$near` operators. The
``2d`` geospatial index supports :operator:`$uniqueDocs`.

.. example::
Expand All @@ -30,13 +30,13 @@ $uniqueDocs

.. code-block:: javascript

db.list.find( { addrs.loc : { $geoWithin : { $box : [ [ 0 , 0 ] , [ 100 , 100 ] ] } } } )
db.list.find( { "addrs.loc" : { $geoWithin : { $box : [ [ 0 , 0 ] , [ 100 , 100 ] ] } } } )

The following query would return each matching document only once:

.. code-block:: javascript

db.list.find( { addrs.loc : { $geoWithin : { $box : [ [ 0 , 0 ] , [ 100 , 100 ] ], $uniqueDocs: true } } } )
db.list.find( { "addrs.loc" : { $geoWithin : { $box : [ [ 0 , 0 ] , [ 100 , 100 ] ], $uniqueDocs: true } } } )

.. note:: If you specify a value of ``false`` for
:operator:`$uniqueDocs`, MongoDB will return multiple instances of
Expand Down