File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,19 @@ the following:
272
272
Refer to the :manual:`Unique Indexes page </core/index-unique>` in the
273
273
MongoDB server manual for more information.
274
274
275
+ List Indexes
276
+ ------------
277
+
278
+ You can use the ``listIndexes()`` method to list all of the indexes for
279
+ a collection. The `listIndexes()
280
+ <{+api+}/classes/Collection.html#listIndexes>`__ method takes an optional
281
+ `ListIndexesOptions <{+api+}/interfaces/ListIndexesOptions.html>`__
282
+ parameter. The ``listIndexes()`` method returns an object of type
283
+ `ListIndexesCursor <{+api+}/classes/ListIndexesCursor.html>`__.
284
+
285
+ The following code uses the ``listIndexes()`` method to list all the
286
+ indexes in a collection:
287
+
275
288
.. literalinclude:: /code-snippets/indexes/listIndexes.js
276
289
:language: js
277
290
:start-after: start-listIndexes-example
You can’t perform that action at this time.
0 commit comments