1

假设我有这个数据结构:

{
  "posts": {
    "-KmRZyki4Z9I4oKEy5aD" : {
      "data1": "titel",
      "data2": "more text"
    },
    "-KmRZyki4Z9I4oKEy5aD" : {
      "data1": "other titel",
      "data2": "more text text text"
    },
    "-Dmk23sdaokI4oKEy5aD" : {
      "data1": "other titel2",
      "data2": "more text text text"
    }    
  },
    "geofire": {
      "-KmRAohOUaGfkMcWRN0p" : {
        ".priority" : "u30wy2cdfv",
        "g" : "u30wy2cdfv",
        "l" : [ 54.8161474, 32.2299636 ]
      },
      "-KmRZyki4Z9I4oKEy5aD" : {
        ".priority" : "u30wy2cdfv",
        "g" : "u30wy2cdfv",
        "l" : [ 53.8161474, 62.2299636 ]
      },
      "-Dmk23sdaokI4oKEy5aD" : {
        ".priority" : "u30wy2cdfv",
        "g" : "u30wy2cdfv",
        "l" : [ 12.8161474, 12.2299636 ]
      }
    }
  }
}  

现在我正在使用 Geofire 查询来获取某个区域中节点键的数组“结果”。假设这个数组看起来像这样:

results = ["-KmRAohOUaGfkMcWRN0p", "-KmRZyki4Z9I4oKEy5aD"];

我想使用 Polymerfire 元素来获取“posts”下的节点,这些节点的键位于结果数组中。我试着用这个:

<firebase-query
  id="query"
  path="/posts"
  data="{{postdata}}"
  child="[[results]]">    
</firebase-query>

但这不是这样做的正确方法。有人知道该怎么做吗?

亲切的问候

chwzr 李

4

0 回答 0