Skip to content

DOCS-13849 remove documentation for ensureIndex #5124

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

Merged
merged 1 commit into from
Mar 23, 2021
Merged
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
11 changes: 5 additions & 6 deletions source/reference/method.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ Collection
- Wraps the :pipeline:`$group` aggregation stage with a :group:`$sum`
expression to return a count of the number of documents in a
collection or a view.


* - :method:`db.collection.estimatedDocumentCount()`

- Wraps :dbcommand:`count` to return an approximate count of the documents in a collection or a view.

* - :method:`db.collection.createIndex()`

Expand Down Expand Up @@ -94,7 +89,11 @@ Collection

* - :method:`db.collection.ensureIndex()`

- Deprecated. Use :method:`db.collection.createIndex()`.
- Removed. Use :method:`db.collection.createIndex()`.

* - :method:`db.collection.estimatedDocumentCount()`

- Wraps :dbcommand:`count` to return an approximate count of the documents in a collection or a view.

* - :method:`db.collection.explain()`

Expand Down
37 changes: 7 additions & 30 deletions source/reference/method/db.collection.ensureIndex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,14 @@ db.collection.ensureIndex()

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
.. method:: db.collection.ensureIndex()

Definition
----------
.. admonition:: Removed in 5.0
:class: note

.. method:: db.collection.ensureIndex(keys, options)
:method:`db.collection.ensureIndex()` has been replaced by
:method:`db.collection.createIndex()`.

.. seealso::

.. include:: /includes/fact-mongo-shell-method.rst


.. deprecated:: 3.0

:method:`db.collection.ensureIndex()` has been replaced by
:method:`db.collection.createIndex()`.

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.
:method:`db.collection.createIndex()`
13 changes: 6 additions & 7 deletions source/reference/method/js-collection.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ Collection Methods
expression to return a count of the number of documents in a
collection or a view.


* - :method:`db.collection.estimatedDocumentCount()`

- Wraps :dbcommand:`count` to return an approximate count of the documents in a collection or a view.

* - :method:`db.collection.createIndex()`

- Builds an index on a collection.
Expand Down Expand Up @@ -89,7 +84,11 @@ Collection Methods

* - :method:`db.collection.ensureIndex()`

- Deprecated. Use :method:`db.collection.createIndex()`.
- Removed. Use :method:`db.collection.createIndex()`.

* - :method:`db.collection.estimatedDocumentCount()`

- Wraps :dbcommand:`count` to return an approximate count of the documents in a collection or a view.

* - :method:`db.collection.explain()`

Expand Down Expand Up @@ -229,7 +228,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
Expand All @@ -240,6 +238,7 @@ Collection Methods
/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
Expand Down
26 changes: 20 additions & 6 deletions source/release-notes/5.0-compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,29 @@ versions of MongoDB.
Removed Commands
----------------

Starting in MongoDB 5.0, these commands are removed:
Starting in MongoDB 5.0, these these database commands and
:binary:`~bin.mongo` shell helper methods are removed:

- :dbcommand:`shardConnPoolStats` (use :dbcommand:`connPoolStats`
instead). Deprecated since MongoDB 4.4.
.. list-table::
:header-rows: 1

- :dbcommand:`unsetSharding`. Deprecated since MongoDB 4.4.
* - Removed Command
- Alternative

- :dbcommand:`resetError` and :method:`db.resetError()`. Deprecated
since MongoDB 1.6.
* - :method:`db.collection.ensureIndex()`
- :method:`db.collection.createIndex()`

* - :method:`db.resetError()`
- Not available

* - :dbcommand:`resetError`
- Not available

* - :dbcommand:`shardConnPoolStats`
- :dbcommand:`connPoolStats`

* - :dbcommand:`unsetSharding`
- Not available

Removed Parameters
------------------
Expand Down