How to update TTL property "expireAfterSeconds" in the _ts index after its already created?
I am trying to update the *expireAfterSeconds *property in my test cosmosDB collection after its been created. I first created this index by following the command listed here: https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/time-to-live
globaldb:PRIMARY> db.coll.createIndex({"_ts":1}, {expireAfterSeconds: 400000})
I tried running this command again with a new value but it does not work as the index already exists.
According to this MongoDB documentation https://www.mongodb.com/docs/v3.2/reference/command/collMod/#change-expiration-value-for-indexes, I should be using collMod command to update the field.
However when I run this command in the Mongo Shell:
db.runCommand({ collMod:"coll", index:{ keyPattern:{ "_ts":1}, expireAfterSeconds:3600} })
I get this error:
{
"_t" : "OKMongoResponse",
"ok" : 0,
"code" : 115,
"errmsg" : "Command is not supported. ConnectionId 843ed8dc-89e8-4327-880d-69969744de90 ActivityId: 7f2b3a2d-0000-0000-0000-000000000000",
"$err" : "Command is not supported. ConnectionId 843ed8dc-89e8-4327-880d-69969744de90 ActivityId: 7f2b3a2d-0000-0000-0000-000000000000"
}
The server is currently on MongoDB 3.2. How do I correctly update the index with a new TTL value?