I would like to receive every graph item from all ChilDBYAutoID's into a double array.
Also, Is there a better way to do this with a count so there is no auto ID? Such as example:
0 724 1 744 2 745 3 800 . . .
My main goal is to upload many graph values, not just update one. And then retrieve the graph values into a Double Array.
func uploadToFirebase(){
//Firebase Initialization
var ref: FIRDatabaseReference!
ref = FIRDatabase.database().reference()
ref.child("general_room_index").childByAutoId().setValue(["graph_value": totalCountY])
}
databaseRef.child("general_room_index").observeSingleEventOfType(.Value, withBlock: { (snapshot) in
snapshot.value!["medals"] as! [Double]
})
As far as i understood your problem , You gotta change your JSON structure to :-
Initialise your
genera_Room_Index_Count
to 0; Same security rules will apply forgenera_Room_Index_Count
node; Then start appending the valuesSecurity rules