当 Partiton Key 为空时,它的值是多少?

Mar*_* C. 5 azure-cosmosdb

我的记录是分区键所在的错误数据造成的null,我需要清理它们,但到目前为止我还没有成功。

在此输入图像描述

这是我尝试过的:

 var scriptResult = await _dbClient.ExecuteStoredProcedureAsync<dynamic>(
                GetStoredProcLink("BulkDelete"),
                new RequestOptions() { PartitionKey = new PartitionKey(""), EnableScriptLogging = true },
                "select * from c where c.documentDbType = "SomeValue"");
Run Code Online (Sandbox Code Playgroud)

我也尝试过用作 的Undefined.Value参数new PartitionKey()

我从这里撕下了存储过程,但尚未更改任何内容。

注意:如果不明显的话,这是一个分区集合(由/companyId

Ara*_* R. 1

Null、未定义和空字符串在 Cosmos DB 中都是不同的值。你需要类似的东西:new RequestOptions { PartitionKey = new PartitionKey(null) }