Executing a Sequence

To execute the sequence we created in the previous section, use the Store.executeUpdates() method:

...
// Store handle configuration and open skipped for brevity
...

store.on("open",function (err) {
  if (err)
    throw err;

  store.executeUpdates(operations, function(err, result) {
    if (err)
      throw err;
    else {
      console.log("Inserted rows.");
      store.close();
    }
  });

}).on('close', function() {
    console.log('Store closed.');
}).on('error', function(error) {
    console.log(error);
});
store.open(); 

Note that if any of the above errors are thrown, then the entire sequence is aborted, and your data will be in the state it would have been in if you had never executed the sequence at all.

Store.executeUpdates() can optionally take a WriteOptions object. This object allows you to specify:

For an example of using WriteOptions, see Durability Guarantees.