favorites.add(BinaryValue.create(buffer.array()));
buffer.rewind();
}
// Create an update for the user's values
MapUpdate userMapUpdate = new MapUpdate()
.update(numLogins, new CounterUpdate(1)) // counter
.update(lastLoginTime, new RegisterUpdate(now)) // register
.update(loggedIn, new FlagUpdate(true)) // flag
.update(shoppingCart, favorites); // asSet
// Now create an update for the user's entry
MapUpdate userEntryUpdate = new MapUpdate()
.update(username, userMapUpdate);
Location location = new Location(new Namespace(mapBucketType, bucketName), key);
DtUpdateOperation update =
new DtUpdateOperation.Builder(location)
.withOp(userEntryUpdate.getOp())
.build();
cluster.execute(update);
update.get();