"users":{
"steve_rodriquez":{
"ch1":{
"timestamp":2
},
"ch2":{
"timestamp":1
},
"ch3":{
"timestamp":4
},
"ch4":{
"timestamp":3
}
}
}
Rules are defined as
"rules": {
".read": true,
".write": true,
"users":{
".indexOn": ["timestamp"]
}
}
When i try to sort based on time stamp it doesnt work. i added 1,2,3,4 just for example
This is my client side code for it
ref = Database.database().reference()
(ref.child("users").child("steve_rodriquez")).queryOrdered(byChild: "timestamp").observeSingleEvent(of: .value, with: {(snapshot) in
print(snapshot.value as Any)
})