at moment, firebase doesn't stores data in order entered. ex - there 2 existing childs , new child inserted, new child goes , sits in middle of existing ones! guess works alphabet order want store data in correct order only.
firebase.database().ref('somechildref').set({ //could insert anywhere });
i think push insert in correct order push generates unique key don't want, want insert data using set , in correct order.
it not possible insert data firebase desired position. firebase data sorted alphabetically , newly inserted data rearranged accordingly.
use query rules return data in order want.
such as:
orderbychild()
orderbykey()
orderbyvalue()
equalto()
you correct push()
, create unique key , add end, pushing array add end.
Comments
Post a Comment