ios - Firebase Snapshot iteration order -
when iterate through firebase snapshot sample code this:
var ref = firebase(url:my_firebase_url) ref.observesingleeventoftype(.value, withblock: { snapshot in rest in snapshot.children.allobjects [fdatasnapshot] { println(rest.value) } })
is there way guarantee iteration in order of creation of children in node?
to guarantee order of children, use .childbyautoid when generating new child of firebase database location. reference states, key prefixed timestamp. frank says, can use queryorderedbykey specify specific order. since children timestamped, order order of creation.
Comments
Post a Comment