File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1032,6 +1032,29 @@ majority of data-bearing voting members "vote" to commit the index
10321032build. For more information on index builds and the voting process, see
10331033:ref:`index-operations-replicated-build`.
10341034
1035+ Create Multiple Indexes
1036+ ~~~~~~~~~~~~~~~~~~~~~~~
1037+
1038+ .. include:: /includes/cakeSales-example-collection.rst
1039+
1040+ The following example creates multiple indexes on the ``cakeSales``
1041+ collection:
1042+
1043+ .. code-block:: javascript
1044+
1045+ db.cakeSales.createIndexes( [
1046+ { "type": 1 },
1047+ { "orderDate": 1 },
1048+ { "state": 1 },
1049+ { "orderDate": 1, "state": -1 }
1050+ ] )
1051+
1052+ The first three indexes are on single fields and in ascending order
1053+ (``1``).
1054+
1055+ The last index is on ``orderDate`` in ascending order (``1``) and
1056+ ``state`` in descending order (``-1``).
1057+
10351058Additional Information
10361059----------------------
10371060
You can’t perform that action at this time.
0 commit comments