在嗡接着,如數據時:如何使用Om Next中的所有數據進行連接查詢?
{:table {:name "Disk Performance Table"
:data [:statistics :performance]}
:chart {:name "Combined Graph"
:data [:statistics :performance]}
:statistics {:performance {:cpu-usage [45 15 32 11 66 44]
:disk-activity [11 34 66 12 99 100]
:network-activity [55 87 20 1 22 82]}}}
你可以查詢它:
[{:chart [{:data [:cpu-usage]}]}]
得到圖表,加入data
從performance
記錄向下挖cpu-usage
:
{:chart {:data {:cpu-usage [45 15 32 11 66 44]}}}
如何取得整個表現記錄?
另一個潛在的查詢是這樣的:
[{:chart [:data]}]
,但它不能解決加入:
{:chart {:data [:statistics :performance]}}
有沒有分量,因爲這是唯一的有關數據和查詢。這來自練習編號2,並在這裏查詢:https://awkay.github.io/om-tutorial/#!/om_tutorial.D_Queries它使用om/db->樹來運行查詢。
可以展開[標籤:OM-下一頁]標籤維基? –
@MarcusMüller確定,完成! – Pablo