-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 3.4.1
-
Component/s: Index Maintenance, TTL
-
None
-
ALL
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
As per the documentation for 3.4, if a non-TTL single-field index already exists for a field, you cannot create a TTL index on the same field since you cannot create indexes that have the same key specification and differ only by the options. To change a non-TTL single-field index to a TTL index, you must drop the index first and recreate with the expireAfterSeconds option.
{
"v" : 2,
"key" : {
"date" : 1
},
"name" : "date_1",
"ns" : "training.toys"
},
{
"v" : 2,
"key" : {
"date" : 1,
"expireAfterSeconds" : 3900
},
"name" : "date_1_expireAfterSeconds_3900",
"ns" : "training.toys"
}