跳到主要內容 跳至補充內容

JSON_PATH

從 JSON 物件擷取資料。

語法

JSON_PATH(path, JSON)

引數

名稱 類型 描述 預設值
路徑 字串 JSON 路徑運算式
JSON 字串 包含 JSON 文件的字串

範例

路徑 JSON 輸出
"$[*].author.name" "[{"name": "The Great Gatsby", "author": {"name": "F. Scott Fitzgerald"}}, {"name": "Nineteen Eighty-Four", "author": {"name": "George Orwell"}}] [F. Scott Fitzgerald, George Orwell]
"net_id" "{ "net_id": 41 }" 41
"net_id" "{ "net_id": [41, 42] }" [41,42]
"net_id[*]" "{ "net_id": [41, 42] }" [4142]
"net_id.parent" "{ "net_id": [41, 42] }" null
"$[*]" "[1,2,3]" [1, 2, 3]
"$[*].author" "[{"name":"The Great Gatsby", "author":{"name": "F. Scott Fitzgerald"}}, {"name":"Nineteen Eighty-Four", "author": {"name": "George Orwell"}}] [{"name":"F. Scott Fitzgerald"}, {"name":"George Orwell"}]

此頁面是否對您有幫助?

若您發現此頁面或其內容有任何問題——錯字、遺漏步驟或技術錯誤——請告知我們!