javascript - How to make specific architecture in Firebase? -


i want create firebase following structure:

firebasename:   user1:     name: name,     email: email   user2:     name: name,     email: email   user3:     name: name,     email:email 

but can't seem add append data firebase without firebase creating custom key it. example, if want append user1 start out with, data gets created is

firebasename:   funkykey: user1 

how this?

yang li's solution work.

here's 1 (requires firebase javascript sdk):

var ref = new firebase('https://yours.firebaseio.com/'); var name = 'name'; var email = 'email';  ref.set({    firebasename:      user1:       name: name,       email: email     user2:       name: name,       email: email     user3:       name: name,       email:email   } }); 

or:

[1,2,3].foreach(function(index) {     ref.child('user'+index).set({         name: name,         email: email     }); }); 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -