Hello I\'m working on some firebase project and i can save my datas via javascript into firebase database. But i couldn\'t figure it out to auto increment child value (my ch
There is no AutoId in firebase but here is a quick way to set as auto id
Forexample ;
1- create yourModel ( which one u gonna send as model to firebase )
2- DatabaseReference firebaseDatabase;
3- firebaseDatabase =FirebaseDatabase.instance.reference();
4- firebaseDatabase.child("table_name").push().set( yourModel.toJson() );
var result= firebaseDatabase.child("table_name").once().then(
(DataSnapshot datasnapshot){
Map values= datasnapshot.value;
values.forEach((key,value){
print("key:"+key+" value:"+value["name"]);
});
}
);
print(result);
I tried it and works great
Have a nice day !!!