Stay organized with collectionsSave and categorize content based on your preferences.
Options for creating a new transaction.
JSON representation
{// Union fieldmodecan be only one of the following:"readOnly":{object (ReadOnly)},"readWrite":{object (ReadWrite)}// End of list of possible types for union fieldmode.}
Fields
Union fieldmode. The mode of the transaction.modecan be only one of the following:
The transaction can be used for both read and write operations.
ReadOnly
Options for a transaction that can only be used to read documents.
JSON representation
{// Union fieldconsistency_selectorcan be only one of the following:"readTime":string// End of list of possible types for union fieldconsistency_selector.}
Fields
Union fieldconsistency_selector. The consistency mode for this transaction. If not set, defaults to strong consistency.consistency_selectorcan be only one of the following:
This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples:"2014-10-02T15:01:23Z","2014-10-02T15:01:23.045123456Z"or"2014-10-02T15:01:23+05:30".
ReadWrite
Options for a transaction that can be used to read and write documents.
Firestore does not allow 3rd party auth requests to create read-write. transactions.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[[["\u003cp\u003eTransactions can be created in either \u003ccode\u003ereadOnly\u003c/code\u003e or \u003ccode\u003ereadWrite\u003c/code\u003e mode, defining whether they can be used for reading only or for both reading and writing operations.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ereadOnly\u003c/code\u003e transactions support specifying a \u003ccode\u003ereadTime\u003c/code\u003e to read documents at a particular microsecond-precision timestamp within the past hour or, when enabled with Point-in-Time Recovery, at a whole minute within the past 7 days.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ereadWrite\u003c/code\u003e transactions allow for both reading and writing documents, and they can be configured to retry a previous transaction using a base64-encoded string.\u003c/p\u003e\n"],["\u003cp\u003eFirestore restricts the creation of \u003ccode\u003ereadWrite\u003c/code\u003e transactions from third-party authorization requests.\u003c/p\u003e\n"]]],[],null,["# TransactionOptions\n\nOptions for creating a new transaction.\n\nReadOnly\n--------\n\nOptions for a transaction that can only be used to read documents.\n\nReadWrite\n---------\n\nOptions for a transaction that can be used to read and write documents.\n\nFirestore does not allow 3rd party auth requests to create read-write. transactions."]]