Ensuring Index on collection

Ensuring Index on collection

Indexes on collections may be created via ensure action:

for example:

creates one index that will be constructed in background : ensure(index("foo" -> Order.Ascending) background true)
   creates one compound index that is sparse :

ensure(index("foo" -> Order.Descending, "doo" -> Order.Ascending) sparse true)

All attributes that can be specified can be found in http://docs.mongodb.org/manual/reference/method/db.collection.ensureIndex/#db.collection.ensureIndex.

Operations:

 Index created when none is present
 Index already created we silently skip it

Total for specification CollectionEnsureIndexSpec
Finished in5 seconds, 582 ms
Results2 examples, 0 failure, 0 error