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-08-22 UTC."],[[["\u003cp\u003eThis webpage provides documentation for the \u003ccode\u003eMutation\u003c/code\u003e class within the Cloud Spanner C++ library, with versions ranging from 2.11.0 to 2.37.0-rc.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMutation\u003c/code\u003e 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.\u003c/p\u003e\n"],["\u003cp\u003eUsers can create \u003ccode\u003eMutation\u003c/code\u003e objects using builders like \u003ccode\u003eInsertMutationBuilder\u003c/code\u003e and \u003ccode\u003eUpdateMutationBuilder\u003c/code\u003e, and the documentation notes that creating an empty \u003ccode\u003eMutation\u003c/code\u003e object with its default constructor will result in an object that is unusable with the Cloud Spanner API.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation includes details on the class constructors, move/copy assignment operators, and methods \u003ccode\u003eas_proto()\u003c/code\u003e for converting the mutation to its underlying proto representation, in both constant and non-constant forms.\u003c/p\u003e\n"],["\u003cp\u003eThe document mentions the mutation API, and for further details it links to \u003ca href=\"https://cloud.google.com/spanner/docs/modify-mutation-api\"\u003ehttps://cloud.google.com/spanner/docs/modify-mutation-api\u003c/a\u003e.\u003c/p\u003e\n"]]],[],null,[]]