This is my Firebase database:
ft-records userX@gmail _com 2013-01-01 00:00:00 GMT addedByUser: " userX@gmail.com " notes: "Boooo" time: "2013-01-01 00:00:00 GMT" 2013-01-02 10:00:00 GMT addedByUser: " userX@gmail.com " notes: "Yeaah" time: "2013-01-02 10:00:00 GMT" userY@gmail _com 2013-01-01 03:00:00 GMT addedByUser: " userY@gmail.com " notes: "Ok" time: "2013-01-01 03:00:00 GMT"
I can request this data like this for an authenticated user, for example. userX @gmail_com
let userRecords = self.ref.child(self.user.email.replacingOccurrences(of: ".", with: "_", options: .literal, range: nil)) userRecords.queryOrdered(byChild: "time").queryStarting(atValue: startOfDayDateString).queryEnding(atValue:endOfDayDateString).observe(FIRDataEventType.value, with: { snapshot in ... } )
But if I want to request all notes from all users for a certain date, how can I achieve this?
I needed to somehow create a template for reading all the children from the root, and then request the time of each child. But I'm not sure how to do this.
Can I do something like this?
let ref = FIRDatabase.database().reference(withPath: "ft-records/*")
source share