question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API with transaction and write as parameter

See original GitHub issue

I think transaction.GetDocumentSnapshotAsync and all similar api is not so convenient

Instead, could we write it as

firestoreDB.Collection("players").Document(follow.Key).SnapshotAsync(transaction);

It could be just an extension method

public static Task<DocumentSnapshot> SnapshotAsync(this DocumentReference doc,Transaction transaction,CancellationToken cancellationToken = default(CancellationToken))
{
    return transaction.GetDocumentSnapshotAsync(doc,cancellationToken);
}

// same for query / create / set / update / delete

Also I wish this could be possible

firestoreDB.Value.Collection("players").StreamAsync(transaction); // no equivalence in transaction

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
mikelehencommented, May 4, 2018

That’s a reasonable suggestion, thanks!

We’ll keep it in mind for the future and watch out for other people trying to write common code that works across Transaction and WriteBatch objects. If it’s a common pattern it may be worth introducing the interface.

1reaction
schmidt-sebastiancommented, Apr 27, 2018

Transactions are definitely not going away! There is some overlap with other APIs that might help you and others in cases where running everything within the context of a single function is not the best option.

That being said, we value user feedback tremendously and are still very much evolving our API. We haven’t gotten much feedback about this specific part of the API, and as such, value every opinion we can get on this matter. I will discuss your proposal with the rest of our team and keep you updated (likely by the end of next week).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing Transactions (REST Application Developer's ...
The REST Client API provides transaction control through the /transactions service and a txid parameter available on document manipulation and search ...
Read more >
What issues might we have using query parameters in a ...
Here is a case where typical RESTful API scaffolding reaches it's limits. It would probably be preferable to create some convenience methods ...
Read more >
REST API Transaction
Parameter Type : Choose GraphQL if you wish to define the GraphQL query to be sent to the endpoint. GraphQL Query:Provide the GraphQL...
Read more >
Start Transaction (QYPESTRT, qypeStartTransaction) API
This API can be used to provide both trace type of performance data - collected ... uses the API application identifier parameter as...
Read more >
TransactWriteItems - Amazon DynamoDB - AWS Documentation
TransactWriteItems is a synchronous write operation that groups up to 100 action requests. These actions can target items in different tables, but not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found