Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-7188

Java 3.0: full document replace example missing xattrs section in the subdoc api

    XMLWordPrintable

Details

    Description

      missing example of how to replace full document with the subdoc API while also updating the xattrs.

       

             JsonObject docContent = JsonObject.create().put("body", "value");
         collection.mutateIn("doc-id", Arrays.asList(
                     MutateInSpec.upsert("foo", "bar").xattr().createPath(),
                     MutateInSpec.replace("", docContent)),
                     MutateInOptions.mutateInOptions().storeSemantics(StoreSemantics.UPSERT)
              );
      

       

       

      The empty “” represent the full doc set.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richard.smedley Richard Smedley
            roi.katz Roi Katz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty