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 @@ -1036,6 +1036,29 @@ majority of data-bearing voting members "vote" to commit the index
10361036build. For more information on index builds and the voting process, see
10371037:ref:`index-operations-replicated-build`.
10381038
1039+ Create Multiple Indexes
1040+ ~~~~~~~~~~~~~~~~~~~~~~~
1041+
1042+ .. include:: /includes/cakeSales-example-collection.rst
1043+
1044+ The following example creates multiple indexes on the ``cakeSales``
1045+ collection:
1046+
1047+ .. code-block:: javascript
1048+
1049+ db.cakeSales.createIndexes( [
1050+ { "type": 1 },
1051+ { "orderDate": 1 },
1052+ { "state": 1 },
1053+ { "orderDate": 1, "state": -1 }
1054+ ] )
1055+
1056+ The first three indexes are on single fields and in ascending order
1057+ (``1``).
1058+
1059+ The last index is on ``orderDate`` in ascending order (``1``) and
1060+ ``state`` in descending order (``-1``).
1061+
10391062Additional Information
10401063----------------------
10411064
You can’t perform that action at this time.
0 commit comments