Database Reference
In-Depth Information
Table 6.1 Table 6-1: Optional Parameters for MongoDB Index Creation
Name
Type
Description
true / false Causes the index to be built in the
background. If this is false , the
database will be unresponsive
while the index is built. If the
collection is large, this can mean
minutes of downtime.
background
true / false Requires that all the values in this
index are unique. This is set on
the index automatically created
for the _ id field.
unique
string
Overrides the auto-generated
name of the index
name
true / false Creates a unique index by deleting
documents with the same index
value after the first has been
found. Use with caution.
dropDups
true / false Only include documents that
contain the fields specified by the
index. Can result in smaller
indexes if many documents do not
contain a particular field.
sparse
expireAfterSeconds integer
The time-to-live for documents
according to the timestamp used
for this field. Setting this option
causes the index to become a TTL
index. It cannot be used on
compound indexes, and the field
must be a date type.
version
Different versions of MongoDB
use different indexing formats and
schemes. The scheme can be
chosen with this parameter. This
parameter should never be used.
v
 
Search WWH ::




Custom Search