From 9ad0cce02b809d4d3178444145cabb1efbece9cc Mon Sep 17 00:00:00 2001 From: Dave Cuthbert Date: Wed, 17 Mar 2021 11:11:41 -0400 Subject: [PATCH 1/2] DOCS-13849 remove ensureIndex --- source/reference/method.txt | 4 ---- .../method/db.collection.ensureIndex.txt | 16 +++++++++------- source/reference/method/js-collection.txt | 5 ----- source/release-notes/5.0-compatibility.txt | 2 ++ 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/source/reference/method.txt b/source/reference/method.txt index 752206d0bcd..a440f46f739 100644 --- a/source/reference/method.txt +++ b/source/reference/method.txt @@ -92,10 +92,6 @@ Collection - Removes all indexes on a collection. - * - :method:`db.collection.ensureIndex()` - - - Deprecated. Use :method:`db.collection.createIndex()`. - * - :method:`db.collection.explain()` - Returns information on the query execution of various methods. diff --git a/source/reference/method/db.collection.ensureIndex.txt b/source/reference/method/db.collection.ensureIndex.txt index 2808b84cd71..c218ce2411b 100644 --- a/source/reference/method/db.collection.ensureIndex.txt +++ b/source/reference/method/db.collection.ensureIndex.txt @@ -13,17 +13,15 @@ db.collection.ensureIndex() Definition ---------- -.. method:: db.collection.ensureIndex(keys, options) - - - .. include:: /includes/fact-mongo-shell-method.rst - - - .. deprecated:: 3.0 +.. admonition:: Removed in 5.0 :method:`db.collection.ensureIndex()` has been replaced by :method:`db.collection.createIndex()`. +.. method:: db.collection.ensureIndex(keys, options) + + .. include:: /includes/fact-mongo-shell-method.rst + Creates an index on the specified field if the index does not already exist. @@ -38,3 +36,7 @@ Additional Information - :method:`db.collection.getIndexes()` to view the specifications of existing indexes for a collection. + +.. seealso:: + + :method:`db.collection.createIndex()` diff --git a/source/reference/method/js-collection.txt b/source/reference/method/js-collection.txt index 8d61797d901..262e370821c 100644 --- a/source/reference/method/js-collection.txt +++ b/source/reference/method/js-collection.txt @@ -87,10 +87,6 @@ Collection Methods - Removes all indexes on a collection. - * - :method:`db.collection.ensureIndex()` - - - Deprecated. Use :method:`db.collection.createIndex()`. - * - :method:`db.collection.explain()` - Returns information on the query execution of various methods. @@ -239,7 +235,6 @@ Collection Methods /reference/method/db.collection.drop /reference/method/db.collection.dropIndex /reference/method/db.collection.dropIndexes - /reference/method/db.collection.ensureIndex /reference/method/db.collection.explain /reference/method/db.collection.find /reference/method/db.collection.findAndModify diff --git a/source/release-notes/5.0-compatibility.txt b/source/release-notes/5.0-compatibility.txt index b04acf99788..c16cc5420a2 100644 --- a/source/release-notes/5.0-compatibility.txt +++ b/source/release-notes/5.0-compatibility.txt @@ -27,6 +27,8 @@ Starting in MongoDB 5.0, these commands are removed: - :dbcommand:`resetError` and :method:`db.resetError()`. Deprecated since MongoDB 1.6. +- :method:`db.collection.ensureIndex()` Deprecated since MongoDB 3.0. + Removed Parameters ------------------ From 9b10eb73e335fa2e5bb87e7a5834c322e1252b78 Mon Sep 17 00:00:00 2001 From: Dave Cuthbert Date: Wed, 17 Mar 2021 13:50:42 -0400 Subject: [PATCH 2/2] DOCS-13849 alternate view --- .../method/db.collection.ensureIndex.txt | 22 ------------------- source/reference/method/js-collection.txt | 3 ++- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/source/reference/method/db.collection.ensureIndex.txt b/source/reference/method/db.collection.ensureIndex.txt index c218ce2411b..053939d1ed0 100644 --- a/source/reference/method/db.collection.ensureIndex.txt +++ b/source/reference/method/db.collection.ensureIndex.txt @@ -10,33 +10,11 @@ db.collection.ensureIndex() :depth: 1 :class: singlecol -Definition ----------- - .. admonition:: Removed in 5.0 :method:`db.collection.ensureIndex()` has been replaced by :method:`db.collection.createIndex()`. -.. method:: db.collection.ensureIndex(keys, options) - - .. include:: /includes/fact-mongo-shell-method.rst - - Creates an index on the specified field if the index does not - already exist. - -Additional Information ----------------------- - -- Use :method:`db.collection.createIndex()` rather than - :method:`db.collection.ensureIndex()` to create new indexes. - -- The :doc:`/indexes` section of this manual for full - documentation of indexes and indexing in MongoDB. - -- :method:`db.collection.getIndexes()` to view the specifications of - existing indexes for a collection. - .. seealso:: :method:`db.collection.createIndex()` diff --git a/source/reference/method/js-collection.txt b/source/reference/method/js-collection.txt index 262e370821c..0fc38c9e8aa 100644 --- a/source/reference/method/js-collection.txt +++ b/source/reference/method/js-collection.txt @@ -225,7 +225,6 @@ Collection Methods /reference/method/db.collection.copyTo /reference/method/db.collection.count /reference/method/db.collection.countDocuments - /reference/method/db.collection.estimatedDocumentCount /reference/method/db.collection.createIndex /reference/method/db.collection.createIndexes /reference/method/db.collection.dataSize @@ -235,6 +234,8 @@ Collection Methods /reference/method/db.collection.drop /reference/method/db.collection.dropIndex /reference/method/db.collection.dropIndexes + /reference/method/db.collection.ensureIndex + /reference/method/db.collection.estimatedDocumentCount /reference/method/db.collection.explain /reference/method/db.collection.find /reference/method/db.collection.findAndModify