111
rated 0 times
[
114]
[
3]
/ answers: 1 / hits: 20016
/ 9 Years ago, wed, july 15, 2015, 12:00:00
I have a Firebase record searches: 0 for each user. On some event, I'd like to add 1 to what the current count is. I've gotten this far, but for some reason, it's not working:
du.fbAddSearchCount = function() {
var usr = new Firebase(firebase_url + /users/ + user_uid);
usr.on(value, function(snapshot) {
user = snapshot.val();
var usersRef = ref.child(users);
var fbUser = usersRef.child(user_uid);
fbUser.update( {
searches: user.searches + 1
});
}
}
Any help to get this working?
Thank you.
More From » firebase