Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (38 sloc) 1.39 KB
===========
listIndexes
===========
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
.. versionadded:: 3.0.0
Definition
----------
.. dbcommand:: listIndexes
Returns information about the indexes on the specified collection.
Specifically, the command returns a document that contains
information with which to create a cursor to the index information.
Index information includes the keys and options used to create the
index. The :binary:`~bin.mongo` shell provides the
:method:`db.collection.getIndexes()` helper.
The command has the following form:
.. code-block:: javascript
{ "listIndexes": "<collection-name>" }
.. include:: /includes/apiargs/dbcommand-listIndexes-field.rst
Required Access
---------------
.. include:: /includes/extracts/actions-listIndexes.rst
Output
------
.. data:: listIndexes.cursor
A document that contains information with which to create a cursor
to index information. The cursor information includes the cursor id,
the full namespace for the command, as well as the first batch of
results. Index information includes the keys and options used to
create the index. For information on the keys and index options, see
:method:`db.collection.createIndex()`.
.. data:: listIndexes.ok
The return value for the command. A value of ``1`` indicates
success.
You can’t perform that action at this time.