MutationGroup

MutationGroup

A group of mutations to be committed together. Related mutations should be placed in a group.

For example, two mutations inserting rows with the same primary key prefix in both parent and child tables are related.

This object is created and returned from Database#MutationGroup.

Constructor

new MutationGroup()

Example
```
const {Spanner} = require('@google-cloud/spanner');
const spanner = new Spanner();

const instance = spanner.instance('my-instance');
const database = instance.database('my-database');

const mutationGroup = new MutationGroup();
mutationGroup.insert('Singers', {SingerId: '123', FirstName: 'David'});
mutationGroup.update('Singers', {SingerId: '123', FirstName: 'Marc'});

database.batchWriteAtLeastOnce([mutationGroup], {})
   .on('error', console.error)
   .on('data', response => {
         console.log('response: ', response);
     })
    .on('end', () => {
         console.log('Request completed successfully');
     });
```