python - 如何获取 Azure 表查询中返回的实体数量?

标签 python azure-table-storage

我正在使用 python 对 Azure 表进行查询。

    query = table_service.query_entities(table_name, filter=filter_string)

如何查看此查询返回的实体数量?我尝试过使用

query.count
query.count()

但没有运气。我收到以下错误。

'ListGenerator' object has no attribute 'count

在线搜索不断返回有关获取表中不相关的整行数的结果。

最佳答案

您应该使用len(query.items)来获取返回的实体的数量。

代码如下:

query = table_service.query_entities(table_name, filter=filter_string)

print(len(query.items))

测试结果如下:

enter image description here

关于python - 如何获取 Azure 表查询中返回的实体数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66111206/

相关文章:

Python将日期字符串转换为python日期并减去

python - 如何在Python的for循环中获取值

python - 创建不同类的类实例的更有效方法?

特定文件夹结构中的文件的 Azure 存储

python列表将每个值相乘

python - 异步任务的开销是多少?

c# - 不使用 KeyVault 的 Azure 表存储客户端加密

c# - Windows Azure 表,使用 Contains 进行查询

node.js - 表实体未保留

azure - 将点查询连接在一起时 Azure 表存储中的性能不可靠