1

Lets say i have this Data Structure:

{
  "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 ]
      }
    }
  }
}  

Now I am using a Geofire query to get a Array "results" of node-keys which are in a certain region. lets say this array looks like this:

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

I want to use the Polymerfire Element to get the nodes under "posts" which have a key which is in the results array. I tried to use this:

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

but it is not the propper way to do that. Does someone know how to do this?

Kind Regards

chwzr lee

Chwzr Lee
  • 21
  • 5
  • This might help: https://stackoverflow.com/questions/37798366/android-firebase-query-startat-not-working-as-expected – Ciprian Jun 13 '17 at 08:15
  • they query for a child value ( at mine e.g. "data1" ) but I want to query by the key of the node like "-KmRAohOUaGfkMcWRN0p".. and there is no method provided in the polymerfire element. I think it is common to query for a array of keys, since you have to flatten the data structure in firebase. – Chwzr Lee Jun 13 '17 at 08:41
  • Please look [here](https://github.com/firebase/geofire-js) under Example-Usage ... the Last Line is describing well what i want to archive with polymerfire.. : "To display any additional information about the bars, you can load the information for each bar returned by the query at /bars/." – Chwzr Lee Jun 13 '17 at 10:28

0 Answers0