3

I am using java couchbase sdk in my application. I am using AsyncMutateInBuilder for doing mutations. Now when i upsert a mutation or try to remove a path which doesn't exist in the document, I get PathNotFoundException which makes sense.

While upserting the mutation, I am using SubDocOptionsBuilder to create a path if it doesn't exist before upserting a mutation. This is how it looks like-

mutator.upsert(this.path, this.data, new SubdocOptionsBuilder().createPath(Boolean.TRUE))

This works perfectly fine and. Now I want to achieve the same results while removing a path from document. If the path doesn't exist, I don't want to end up with PathNotFoundException. I would just like to move on. Is there a way i can achieve this?

Kunal gupta
  • 481
  • 2
  • 7
  • 19
  • What version of the SDK are you using? I just tried this with the latest .NET SDK, and I did not get an exception when trying to remove a path that doesn't exist (and I would expect that behavior from the Java SDK too). – Matthew Groves Jul 29 '20 at 13:38
  • I am using sdk 2.7.2. – Kunal gupta Aug 04 '20 at 14:15

0 Answers0