Angularfire: [Feature] Angularfire2 transaction

Created on 29 Oct 2016  路  5Comments  路  Source: angular/angularfire

I've been checking how I can add a value to existing value in my firebase database, and I was refered to the following:

https://firebase.google.com/docs/reference/js/firebase.database.Reference#transaction

transaction()is used to modify the existing value to a new value, ensuring there are no conflicts with other clients writing to the same location at the same time.

If it does exists and can be used with angularfire2, I couldn't find anything about it in the documentation.

RFC / discussion / question

Most helpful comment

Duplicate of #201

FYI - You can use it directly from the SDK.

import * as firebase from 'firebase';
firebase.database().transaction(...);

All 5 comments

@theunreal Did you get a chance to look at this section.

@mukesh51 Yes, Do you see anything about transaction? Because there is nothing about it.

@theunreal I didn't see the transaction method, but my guess is, if it has to be available, then it has to exists in firebase_list_observable definition file. Again, my assumption is, I don't believe angularFire2 will mimic every method of firebase API, which might not make sense.

I'll leave it to experts.
@katowulf @davideast @jeffbcross do you guys want to weigh in here, please.

@theunreal I聽added transaction support in PR https://github.com/angular/angularfire2/pull/610 if want ;)

Duplicate of #201

FYI - You can use it directly from the SDK.

import * as firebase from 'firebase';
firebase.database().transaction(...);
Was this page helpful?
0 / 5 - 0 ratings