-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent transaction API between admin and js #2112
Labels
Comments
I found a few problems with this issue:
|
Thank you for your question. Unfortunately, it isn't really feasible merge the two implementations because they are quite different, despite the superficial similarities in the API. More specifically:
Note that the feature request to add |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
While porting some code from admin to client so that I can take advantage of firestore rules from firestore functions (because admin ignores rules, sigh) and re-use some common code between client and server, I discovered that the admin sdk allows me to pass in a refOrQuery and the client sdk only allows a ref.
https://firebase.google.com/docs/reference/js/firebase.firestore.Transaction.html#get
get(documentRef: DocumentReference): Promise
https://googleapis.dev/nodejs/firestore/latest/Transaction.html#get
get(refOrQuery) → {Promise}
The client sdk is also missing
transaction.getAll()
andtransaction.create()
:https://googleapis.dev/nodejs/firestore/latest/Transaction.html#getAll
https://googleapis.dev/nodejs/firestore/latest/Transaction.html#create
It would be nice if the two apis were more consistent or heck... merged into one. Is there a reason they need to be separate?
The text was updated successfully, but these errors were encountered: