有没有一种方法可以利用 Table (azure-storage) 客户端 API 通过 CosmosDb 设置项目级别 TTL(生存时间)?
Is there a way to set item level TTL(Time-To-Live) with CosmosDb utilizing the Table (azure-storage) client API?
我正在为一个项目使用 CosmosDb,并且首先尝试使用 Document-db java SQL API。有了那个 API 我可以直接在文档本身上设置项目级 TTL。例如
Document document = new Document(new Gson().toJson(testObject));
document.setTimeToLive(10); // Time to live 10 seconds
documentClient.createDocument(documentCollection.getSelfLink(), document, null,
false).getResource();
不过,我也有兴趣使用TableAPI。我在文档中找不到任何关于设置项目级 TTL 的内容。 https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-how-to-use-java
我正在使用 https://github.com/Azure/azure-storage-java 版本 8.0.0
https://mvnrepository.com/artifact/com.microsoft.azure/azure-storage
是否可以这样做,或者至少为 table 中的所有项目设置服务器端 TTL?谢谢!
今天,Table API 不公开任何 TTL 功能,因此很遗憾,您不能将 TTL 与 Table API 一起使用,即使 Cosmos 在封面。
我正在为一个项目使用 CosmosDb,并且首先尝试使用 Document-db java SQL API。有了那个 API 我可以直接在文档本身上设置项目级 TTL。例如
Document document = new Document(new Gson().toJson(testObject));
document.setTimeToLive(10); // Time to live 10 seconds
documentClient.createDocument(documentCollection.getSelfLink(), document, null,
false).getResource();
不过,我也有兴趣使用TableAPI。我在文档中找不到任何关于设置项目级 TTL 的内容。 https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-how-to-use-java 我正在使用 https://github.com/Azure/azure-storage-java 版本 8.0.0 https://mvnrepository.com/artifact/com.microsoft.azure/azure-storage
是否可以这样做,或者至少为 table 中的所有项目设置服务器端 TTL?谢谢!
今天,Table API 不公开任何 TTL 功能,因此很遗憾,您不能将 TTL 与 Table API 一起使用,即使 Cosmos 在封面。