Azure Table 存储:是否可以使用与添加两个列值的结果进行比较的查询条件?

Azure Table Storage: Is it possible to use a query condition that compares to result of adding two column values?

我有一个 Azure 存储 table,我在其中存储遇到抽认卡的结果。它有像这样的列:

UserID CardID ConsecutiveCorrect TotalCorrect TotalIncorrect

遗憾的是,我没想到要为 TotalEncounters 添加一列。我正在想办法查询已被 N 次的卡片。如果我可以只说 WHERE TotalCorrect + TotalIncorrect = N,这会很容易,但我在 API 中看不到任何可以这样做的地方。

我只是错过了一些很棒的东西吗?或者这在 Azure Table 存储中实际上是不可能的?

Am I just missing something awesome? Or is this actually impossible in Azure Table Storage?

你没有错过。不幸的是,这种事情在 Azure Table 存储中是不可能的。您将不得不在您的应用程序代码中仅通过获取所有实体来应用这种逻辑。

我的建议是在 table 中为 TotalEncounters 添加另一个属性,并在 TotalCorrect and/or TotalIncorrect 属性出现时继续更新其值变了。这样您就不必在应用程序代码中应用此逻辑。