簡體   English   中英

我怎樣才能獲得這個 Cosmos db 屬性

[英]How can I get this cosmos db attribute

我需要根據“destinationUrl”屬性創建一個“select *”,但是當我嘗試時:

select *
from c
where c.networkConnections.destinationUrl != null

它不起作用。 什么是正確的語法?

{
    "id": "5ec2605d-ef57-471c-afd8-ea217b12c0xxx",
    "confidence": null,
    "createdDateTime": "2021-05-22T03:41:52.9Z",
    "status": "inProgress",
    "title": "asd",
    "vendorInformation": {
        "provider": "asd",
        "providerVersion": null,
        "subProvider": null,
        "vendor": "asd"
    },
    "alertDetections": [],
    "cloudAppStates": [],
    "fileStates": [],
    "hostStates": [],
    "historyStates": [],
    "investigationSecurityStates": [],
    "messageSecurityStates": [],
    "networkConnections": [
        {
            "applicationName": null,
            "destinationAddress": null,
            "destinationDomain": null,
            "destinationLocation": null,
            "destinationPort": null,
            "destinationUrl": "waitingroom.snow.com"

        }
    ],
    "processes": [],
    "registryKeyStates": [],
    "securityResources": [],
    "triggers": []
}

SELECT c.id FROM c join t in c.networkConnections where t.destinationUrl != null

因為destinationUrl是數組類型,所以我們需要使用join作為子查詢。 我們還需要檢查數組destinationUrl總是有項目或有多個項目。

我的意思是我們是否需要考慮這些情況? 如果不需要,那么我上面的查詢就足夠了。

"networkConnections": [],

"networkConnections": [
        {
            "applicationName": null,
            "destinationAddress": null,
            "destinationDomain": null,
            "destinationLocation": null,
            "destinationPort": null,
            "destinationUrl": null
        },
        {
            "applicationName": null,
            "destinationAddress": null,
            "destinationDomain": null,
            "destinationLocation": null,
            "destinationPort": null,
            "destinationUrl": "asdfasdf"
        }
    ]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM