From 14d3722987af0ca354336647bc378f0c49da4828 Mon Sep 17 00:00:00 2001 From: ravind Date: Fri, 4 Dec 2015 14:05:30 -0500 Subject: [PATCH] DOCS-6621 : Move $natural to cursor.hint() DOCS-6719 : Remove Query Modifier menu item --- config/redirects.yaml | 7 +++ .../apiargs-method-cursor.hint-param.yaml | 5 +++ source/includes/toc-operator-landing.yaml | 4 -- source/reference/method/cursor.hint.txt | 14 ++++++ source/reference/method/js-cursor.txt | 2 + source/reference/operator/meta/natural.txt | 43 ++----------------- source/reference/operator/query-modifier.txt | 19 +------- 7 files changed, 32 insertions(+), 62 deletions(-) diff --git a/config/redirects.yaml b/config/redirects.yaml index 3cf36b00e84..a1d3247fd6f 100644 --- a/config/redirects.yaml +++ b/config/redirects.yaml @@ -960,4 +960,11 @@ type: 'redirect' code: 303 outputs: - 'before-v3.0' +--- +from : '/reference/operator/query-modifier' +to: '/reference/method/js-cursor' +type: 'redirect' +code: 303 +outputs: + - 'after-v3.0' ... diff --git a/source/includes/apiargs-method-cursor.hint-param.yaml b/source/includes/apiargs-method-cursor.hint-param.yaml index 2ac2a0c7ebc..befa9c7ede0 100644 --- a/source/includes/apiargs-method-cursor.hint-param.yaml +++ b/source/includes/apiargs-method-cursor.hint-param.yaml @@ -3,6 +3,11 @@ description: | The index to "hint" or force MongoDB to use when performing the query. Specify the index either by the index name or by the index specification document. + + You can also specify ``{ $natural : 1 }`` to force the query to perform a + forwards collection scan, or ``{ $natural : -1 }`` for a reverse + collection scan. + interface: method name: index operation: cursor.hint diff --git a/source/includes/toc-operator-landing.yaml b/source/includes/toc-operator-landing.yaml index d2622165779..e0dee5c8d4b 100644 --- a/source/includes/toc-operator-landing.yaml +++ b/source/includes/toc-operator-landing.yaml @@ -12,8 +12,4 @@ file: /reference/operator/aggregation description: | Aggregation pipeline operations have a collection of operators available to define and manipulate documents in pipeline stages. ---- -file: /reference/operator/query-modifier -description: | - Query modifiers determine the way that queries will be executed. ... diff --git a/source/reference/method/cursor.hint.txt b/source/reference/method/cursor.hint.txt index c9226b5487b..83dba73955b 100644 --- a/source/reference/method/cursor.hint.txt +++ b/source/reference/method/cursor.hint.txt @@ -41,6 +41,20 @@ You can also specify the index using the index name: .. code-block:: javascript db.users.find().hint( "age_1" ) + +You can specify ``{ $natural : 1 }`` to force the query to perform a forwards +collection scan: + +.. code-block:: javascript + + db.users.find().hint( { $natural : 1 } ) + +You can also specify ``{ $natural : -1 }`` to force the query to perform a +reverse collection scan: + +.. code-block:: javascript + + db.users.find().hint( { $natural : -1 } ) .. seealso:: diff --git a/source/reference/method/js-cursor.txt b/source/reference/method/js-cursor.txt index 3855d81c9e0..75010299a98 100644 --- a/source/reference/method/js-cursor.txt +++ b/source/reference/method/js-cursor.txt @@ -4,6 +4,8 @@ Cursor Methods .. default-domain:: mongodb +These methods modify the way that the underlying query is executed. + .. include:: /includes/toc/table-method-cursor.rst .. include:: /includes/toc/method-cursor.rst diff --git a/source/reference/operator/meta/natural.txt b/source/reference/operator/meta/natural.txt index 550547abc17..d8a7c8e215c 100644 --- a/source/reference/operator/meta/natural.txt +++ b/source/reference/operator/meta/natural.txt @@ -9,45 +9,8 @@ $natural Definition ---------- -.. operator:: $natural - - Use the :operator:`$natural` operator to use :term:`natural order` for - the results of a sort operation. Natural order refers to the logical - :ref:`ordering ` of documents internally within the - database. - - The :operator:`$natural` operator uses the following syntax to return - documents in the order they exist on disk: - - .. code-block:: javascript - - db.collection.find().sort( { $natural: 1 } ) - -Behavior --------- - -On a sharded collection the :operator:`$natural` operator returns a -collection scan sorted in :ref:`natural order `, the -order the database inserts and stores documents on disk. - -.. include:: /includes/fact-natural-parameter.rst +.. versionchanged:: 3.2 -.. include:: /includes/fact-natural-sort-order-text-query-restriction.rst - -Examples --------- - -Reverse Order -~~~~~~~~~~~~~ - -Use ``{ $natural: -1 }`` to return documents in the reverse order as -they occur on disk: - -.. code-block:: javascript - - db.collection.find().sort( { $natural: -1 } ) - -Additional Information ----------------------- +.. operator:: $natural -:method:`cursor.sort()` + See :method:`cursor.hint()` for :operator:`$natural` usage. diff --git a/source/reference/operator/query-modifier.txt b/source/reference/operator/query-modifier.txt index ac796b6c877..b0c2d020e7c 100644 --- a/source/reference/operator/query-modifier.txt +++ b/source/reference/operator/query-modifier.txt @@ -4,23 +4,6 @@ Query Modifiers .. default-domain:: mongodb -Introduction ------------- - MongoDB provides :doc:`cursor methods ` for -setting options on a query. - -Operators ---------- - -Modifiers -~~~~~~~~~ - -See :doc:`/reference/method/js-cursor` for query modifiers. - -Sort Order -~~~~~~~~~~ - -.. include:: /includes/toc/table-operator-sort-order.rst +setting options or modifiers on a query. -.. include:: /includes/toc/operator-sort-order.rst