在DocumentDB中是否可以像在Sql Server中一样查询“ Where In”?

Deb*_*Deb 5 c# azure-cosmosdb

我有以下简单的Sql Where,其中我正在DocumentDB中尝试使用,但无法使其在Query Explorer中工作:

SELECT * FROM root.DocumentDbTest_AllFieldTypes f
    WHERE f.field1 NOT IN (
                            SELECT g.field1 FROM root.DocumentDbTest_AllFieldTypes g 
                            WHERE g.time = "09:12:34"
                          );
Run Code Online (Sandbox Code Playgroud)

我收到以下错误消息: 语法错误,“ SELECT”附近的语法不正确。

有人可以告诉我执行此IN查询的正确语法吗?

And*_*Liu 1

文档支持子句IN中的运算WHERE符;但它不支持子选择。

换句话说......这是支持的:

SELECT food.id,
       food.description,
       food.tags,
       food.foodGroup,
       food.version
FROM food
WHERE food.foodGroup IN ("Poultry Products",
                         "Sausages and Luncheon Meats")
Run Code Online (Sandbox Code Playgroud)

不支持此操作:

SELECT *
FROM root.DocumentDbTest_AllFieldTypes f
WHERE f.field1 NOT IN
    ( SELECT g.field1
     FROM root.DocumentDbTest_AllFieldTypes g
     WHERE g.time = "09:12:34" );
Run Code Online (Sandbox Code Playgroud)

如果您希望在 DocumentDB 中看到子选择,请通过在DocumentDB 的反馈页面上投票支持此功能来表达您的意见。