在 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
挖掘:cpu-usage
performance
{: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->tree 来运行查询。