Skip to content

Instantly share code, notes, and snippets.

@programmatix
Created June 26, 2020 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save programmatix/a31778394b9f41db9233ed4112924427 to your computer and use it in GitHub Desktop.
Save programmatix/a31778394b9f41db9233ed4112924427 to your computer and use it in GitHub Desktop.
String docId = UUID.randomUUID().toString();
collection.mutateIn(docId, Arrays.asList(
MutateInSpec.upsert("txn.id.txn", UUID.randomUUID().toString()).xattr().createPath(),
MutateInSpec.upsert("txn.id.atmpt", UUID.randomUUID().toString()).xattr().createPath(),
MutateInSpec.upsert("txn.atr.id", "some-atr-id").xattr().createPath(),
MutateInSpec.upsert("txn.op.stgd", JsonObject.create().put("foo", "bar")).xattr().createPath(),
MutateInSpec.upsert("txn.atr.bkt", "default").xattr(),
MutateInSpec.upsert("txn.atr.coll", "_default._default").xattr().createPath(),
MutateInSpec.upsert("txn.op.type", "insert").xattr()
), MutateInOptions.mutateInOptions()
.accessDeleted(true)
.createAsDeleted(true)
.storeSemantics(StoreSemantics.INSERT)
.durability(DurabilityLevel.MAJORITY));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment