javascript - Unable to update an entry in the firebase list -
After some attempts, I still can not find the right way to update a list in Firebase.
I have my Dev account in Firebase, but only for this question I used the sample on public firebase url:
var url1 = New firebase ("https: //samplechat.firebaseio-demo.com/message_list "); Url1.push ({text: 'its work', user_id: '123'}); SetTimeout (function () {url1.on ('child_added', function (snap) {snap.update ({text: 'its not working', user_id: '123'}); snap.child ('text'). ('This is not working'); console.log ('Message in range', snap.val ());})}}, 6000); I am able to set up the data, but when the child_added function is started for the message I get the JavaScript error below:
Unkit type ERROR: There is no undefined function What could be the problem?
You are not using the data snapshot object right inside your function.
To change it
snap.ref (). Update ({text: '....', user_id: '...'}); If you were only looking to get the price, then you
snap.val ()
Comments
Post a Comment