How would I modify the following to fail with concurrent writes (Using If-Match and ETag headers) ?
let sync = Runtime.getSync();
exports.handler = function(context, event, callback) {
let map = sync.syncMaps("MyMap");
map.syncMapItems(event.Digits).fetch().then(item => {
map.syncMapItems(event.Digits).update({key: item.key, data:item.data + 1})
.then(item2 => {
}).catch(err => {
console.log("Update Error:" + err);
});
}).catch(err => {
console.log("Fetch Error:" + err);
});
}