To update the keys and values in my firebase data from javascript , When I do this : -
ref.update({"key" : "value" }) ;
It works fine and updates the data in my firebase database .
But when I do this :-
data = {} ;
email = "mymail"
pass="pass"
data[email] = pass
ref.update(data);
Does't work and when I see the database nothing would have been updated. How to fix this ?
EDIT 1:-
If I directly give , ref.update({email , pass}) , what happens is it updates the data in the database but instead of the string in the email it just stores 'email' as the key in the database . Any fix ?