开发者

CosmosDB - SQL: Check if property in JSON file not exists

开发者 https://www.devze.com 2022-12-07 17:49 出处:网络
I would like to check, if for example the field \'street\' does not exists. I tried this: SELECT * FROM c WHERE NOT IS_DEFINED(c.street)

I would like to check, if for example the field 'street' does not exists.

I tried this: SELECT * FROM c WHERE NOT IS_DEFINED(c.street)

This query gives me all entries that do not have the 'street' defined. If instead of 'street', 'street: "abc"' were written there, then this query would return no result.

I am looking for something else. I want to know if 'street' or 'abc' does not 开发者_Go百科exist. I think, I need an CosmodDB query, which checks, if the property is not in this array. I hope it was understandable.

{
    "customerId": "123456",
    "adress": [
       "street",
       "streetnumber": 1,
       "postcode" : 52965,
       "city": "test"
    ],
}

Thank you.

0

精彩评论

暂无评论...
验证码 换一张
取 消