In addition to the Data Manipulation Language (DML) based APIs, Cloud Spanner supports the mutation API, where the application describes data modification using a data structure instead of a SQL statement.
This class serves as a wrapper for all mutations types. Use the builders, such as InsertMutationBuilder or UpdateMutationBuilder to create objects of this class.
[[["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-07-08 UTC."],[[["This webpage provides documentation for the `Mutation` class within the Cloud Spanner C++ library, spanning multiple versions from 2.11.0 to 2.37.0-rc."],["The `Mutation` class serves as a wrapper for Cloud Spanner's mutation API, allowing data modifications to be defined through a data structure rather than SQL statements."],["Users are directed to utilize builders like `InsertMutationBuilder` or `UpdateMutationBuilder` to instantiate objects of the `Mutation` class."],["The `Mutation` class offers methods for conversion to the underlying proto, through the `as_proto()` function, and includes constructors and assignment operators for object manipulation."],["An important note regarding this class is that empty mutations are not usable with the Cloud Spanner mutation API, as mentioned in the documentation."]]],[]]