Skip to content

Inconsistent transaction API between admin and js #2112

@lookfirst

Description

@lookfirst

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() and transaction.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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions