Skip to content

Commit 7c238b5

Browse files
author
Ed Costello
committed
DOCS-558 add name, cache options to db.collection.ensureIndex()
1 parent c262f06 commit 7c238b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/reference/method/db.collection.ensureIndex.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ db.collection.ensureIndex()
5252
==================== ================= =========
5353
background true or false false
5454
unique true or false false
55+
name string none
56+
cache true or false true
5557
dropDups true or false false
5658
sparse true or false false
5759
expireAfterSeconds integer none
@@ -69,6 +71,14 @@ db.collection.ensureIndex()
6971
or keys matches an existing value in the
7072
index.
7173

74+
:option string name: Specify the name of the index. If unspecified,
75+
the index name will be generated by concatenating
76+
the names of the indexed fields and the sort order.
77+
78+
:option Boolean cache: Specify ``false`` to prevent caching of this
79+
:method:`db.collection.ensureIndex()` call in
80+
the index cache.
81+
7282
:option Boolean dropDups: Specify ``true`` when creating a unique
7383
index, on a field that *may* have
7484
duplicate to index only the first

0 commit comments

Comments
 (0)