In the 2.x client, we were able to:
However, with the new version of the client and
MutateInOptions there appears to be no
upsertDocument() capability. How can we perform this same operation?
Thanks - H
In SDK3 you instead can do a MutateInSpec.replace("", YOUR_CONTENT). The “” indicates the root of the document.
In SDK 3 you’d use MutateInOptions.storeSemantics( StoreSemantics.UPSERT )
I think your solution would replace the entire document if it existed, which doesn’t necessarily mesh up with only updating certain paths… I think the StoreSemantics provided by @david.nault is a better solution (and works with my existing tests, as a bonus)
@unhuman yes, I think I misread your question - David’s answer is the correct one here.