public sealed class BatchWriteRequest : IMessage<BatchWriteRequest>, IEquatable<BatchWriteRequest>, IDeepCloneable<BatchWriteRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Spanner v1 API class BatchWriteRequest.
The request for [BatchWrite][google.spanner.v1.Spanner.BatchWrite].
public bool ExcludeTxnFromChangeStreams { get; set; }
Optional. When exclude_txn_from_change_streams is set to true:
Mutations from all transactions in this batch write operation will not
be recorded in change streams with DDL option allow_txn_exclusion=true
that are tracking columns modified by these transactions.
Mutations from all transactions in this batch write operation will be
recorded in change streams with DDL option allow_txn_exclusion=false or
not set that are tracking columns modified by these transactions.
When exclude_txn_from_change_streams is set to false or not set,
mutations from all transactions in this batch write operation will be
recorded in all change streams that are tracking columns modified by these
transactions.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eBatchWriteRequest\u003c/code\u003e API class is \u003ccode\u003e5.0.0-beta05\u003c/code\u003e, with several previous versions available, ranging back to version \u003ccode\u003e3.5.0\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBatchWriteRequest\u003c/code\u003e is a class within the \u003ccode\u003eGoogle.Cloud.Spanner.V1\u003c/code\u003e namespace and represents a request for a batch write operation in the Google Cloud Spanner v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements multiple interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, allowing it to be used in various contexts within the .NET environment.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBatchWriteRequest\u003c/code\u003e has properties like \u003ccode\u003eExcludeTxnFromChangeStreams\u003c/code\u003e, \u003ccode\u003eMutationGroups\u003c/code\u003e, \u003ccode\u003eRequestOptions\u003c/code\u003e, and \u003ccode\u003eSession\u003c/code\u003e to control the behaviour of batch write operations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBatchWriteRequest\u003c/code\u003e object allows for fine-grained control over change stream recording using \u003ccode\u003eExcludeTxnFromChangeStreams\u003c/code\u003e and contains the ability to apply multiple mutations via \u003ccode\u003eMutationGroups\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Spanner v1 API - Class BatchWriteRequest (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/5.0.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.6.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.5.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.4.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.3.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.2.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.1.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.0.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.15.1/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.14.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.13.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.12.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.11.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.10.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.9.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.8.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.7.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.6.0/Google.Cloud.Spanner.V1.BatchWriteRequest)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.5.0/Google.Cloud.Spanner.V1.BatchWriteRequest) \n\n public sealed class BatchWriteRequest : IMessage\u003cBatchWriteRequest\u003e, IEquatable\u003cBatchWriteRequest\u003e, IDeepCloneable\u003cBatchWriteRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Spanner v1 API class BatchWriteRequest.\n\nThe request for \\[BatchWrite\\]\\[google.spanner.v1.Spanner.BatchWrite\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BatchWriteRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[BatchWriteRequest](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.BatchWriteRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BatchWriteRequest](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.BatchWriteRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[BatchWriteRequest](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.BatchWriteRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.V1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.V1.dll\n\nConstructors\n------------\n\n### BatchWriteRequest()\n\n public BatchWriteRequest()\n\n### BatchWriteRequest(BatchWriteRequest)\n\n public BatchWriteRequest(BatchWriteRequest other)\n\nProperties\n----------\n\n### ExcludeTxnFromChangeStreams\n\n public bool ExcludeTxnFromChangeStreams { get; set; }\n\nOptional. When `exclude_txn_from_change_streams` is set to `true`:\n\n- Mutations from all transactions in this batch write operation will not be recorded in change streams with DDL option `allow_txn_exclusion=true` that are tracking columns modified by these transactions.\n- Mutations from all transactions in this batch write operation will be recorded in change streams with DDL option `allow_txn_exclusion=false or\n not set` that are tracking columns modified by these transactions.\n\nWhen `exclude_txn_from_change_streams` is set to `false` or not set,\nmutations from all transactions in this batch write operation will be\nrecorded in all change streams that are tracking columns modified by these\ntransactions.\n\n### MutationGroups\n\n public RepeatedField\u003cBatchWriteRequest.Types.MutationGroup\u003e MutationGroups { get; }\n\nRequired. The groups of mutations to be applied.\n\n### RequestOptions\n\n public RequestOptions RequestOptions { get; set; }\n\nCommon options for this request.\n\n### Session\n\n public string Session { get; set; }\n\nRequired. The session in which the batch request is to be run.\n\n### SessionAsSessionName\n\n public SessionName SessionAsSessionName { get; set; }\n\n[SessionName](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionName)-typed view over the [Session](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.BatchWriteRequest#Google_Cloud_Spanner_V1_BatchWriteRequest_Session) resource name property."]]