0

Trying to grab data from custom date range and with specific location name "California".

Currently grabbing the date range successfully: but result returns all locations. I'm not sure where to put equalTo.

database.ref('/app/shows').orderByChild('timerange/start').startAt(myStartDate).endAt(myEndDate).once('value', function (snapshot) {
    // stuff
})

my json:

"shows" : {
  "show-15039414000001503945000000" : {
    "timerange" : {
      "end" : 1503945000000,
      "start" : 1503941400000
    },
    "location" : "California"
  },
  "show-15040998000001504101600000" : {
    "timerange" : {
      "end" : 1504101600000,
      "start" : 1504099800000
    },
    "location" : "San Diego"
  }
  ...
}
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
test
  • 2,429
  • 15
  • 44
  • 81
  • Firebase Database queries can only order/filter on a single property, so you cannot filter on both `start` and `location`. But you may be able to combine the values into a single synthetic property, e.g. `"location_start": "California_ 1503941400000"`. See my answer here: http://stackoverflow.com/questions/26700924/query-based-on-multiple-where-clauses-in-firebase – Frank van Puffelen Aug 30 '17 at 23:33
  • @FrankvanPuffelen thanks a lot. – test Aug 31 '17 at 16:29

0 Answers0