当前是否可以使用 cosmos sql api 和 c# 以编程方式验证是否在某些集合上启用了 TTL,如果没有则启用它?
最佳答案
是的,下面的代码应该有帮助。
CosmosClient client = new CosmosClient(connection, options );
Container container = await GetContainer(client, "database1", "container1");
ContainerProperties containerProperties = await container.ReadContainerAsync();
int? ttl = containerProperties.DefaultTimeToLive;
关于azure - 以编程方式验证是否在 Cosmos DB 集合上启用了 TTL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65943093/