[英]How to Enable DefaultTimeToLive ( TTL ) at a collection level for documentdb when the collection is already existing ?
I have tried using :- collection.DefaultTimeToLive = CloudSettings.GetDataRetentionPeriod() * 86400; 我尝试使用:-collection.DefaultTimeToLive = CloudSettings.GetDataRetentionPeriod()* 86400; collection.SetPropertyValue("DefaultTTL", CloudSettings.GetDataRetentionPeriod() * 86400);
collection.SetPropertyValue(“ DefaultTTL”,CloudSettings.GetDataRetentionPeriod()* 86400);
But its not enabling the TTL property as we can see from the azure portal 但是它不能启用TTL属性,就像我们从天蓝色门户网站上看到的那样
For me, DefaultTimeToLive works: 对我而言,DefaultTimeToLive可以工作:
collection.DefaultTimeToLive = <your-value-here>;
var response = await _client.ReplaceDocumentCollectionAsync(collection, request.RequestOptions);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.