Skip to content

Add Query overload typing for Transaction.get #331

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

Closed
wants to merge 1 commit into from

Conversation

adamduren
Copy link

No description provided.

@mikelehen
Copy link
Contributor

Hi! Thanks for the pull request, but the web/mobile Firestore SDKs don't support transaction.get(query) so I don't think this change is correct. Unfortunately they cannot support get(query) as they use optimistic concurrency (optimistically assuming that none of the read documents will change, and then re-running the transaction if they do) rather than pessimistic locking (acquiring exclusive locks on the read documents to prevent them from changing) and there isn't currently a way to support reading queries while doing optimistic concurrency.

@mikelehen mikelehen closed this Nov 27, 2017
@adamduren
Copy link
Author

Thank you for the reply. The differences between what's possibly in the admin vs client apis can be confusing. I see now the admin api docs mention pessimistic locking and accept a query. It might worth be nothing on the client side docs that it uses optimistic locking and as such doesn't support fetching a query. Thanks again!

@firebase firebase locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants