简体   繁体   English

如何在Azure Table Storage查询中测试字段是否存在

[英]How to test for field existence in Azure Table Storage query

I'm facing an interesting question, I had to run a datamigration script yesterday in order to add a field to entries in a Azure table. 我面临一个有趣的问题,我昨天必须运行一个数据迁移脚本,以便将字段添加到Azure表中的条目。 The script crashed just next to the end of its execution, and I have now 50 of my entries which need to be added this field (namely "OrganizationName"). 该脚本在执行结束时立即崩溃,我现在有50个条目需要添加到该字段中(即“ OrganizationName”)。

I'd like to select only these entries, but running this query in Cloud Storage Studio does not return anything: 我只想选择这些条目,但是在Cloud Storage Studio中运行此查询不会返回任何内容:

(OrganizationName eq '')

In C# I have the same result (empty list): 在C#中,我有相同的结果(空列表):

var query = from user in _tableService.GetDataContext().AppUserEntity
                    where 1 == 1 && user.OrganizationName == ""
                    select user;

List<AppUserEntity> list = query.ToList();

I suppose that makes sense, as my entities don't have the field, its value cannot be String.empty. 我想这是有道理的,因为我的实体没有该字段,所以其值不能为String.empty。 But I'm wondering of an efficient way to retrieve these entries other than just retrieving everything and looping, and found nothing satisfying anywhere. 但是我想知道一种有效的方法来检索这些条目,而不仅仅是检索所有内容并循环执行,而找不到任何令人满意的地方。

Any ideas? 有任何想法吗?

(PS: I'm running SDK 1.8, which also might be part of the problem) (PS:我正在运行SDK 1.8,这也可能是问题的一部分)

可能会在“时间戳记”上进行查询,以获取脚本崩溃时被跳过的行进行更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM