Uploaded image for project: 'Couchbase Go SDK'
  1. Couchbase Go SDK
  2. GOCBC-1051

Ability to create xattr and document in single operation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Blocker
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: library
    • Labels:
      None

      Description

      Sync Gateway needs the ability to create a document and system xattr in a single operation.  The subdoc API in V2 doesn't appear to support this.

      This was supported in V1, sample code from SG here:

       

      mutateInBuilder := bucket.MutateInEx(k, gocb.SubdocDocFlagMkDoc, gocb.Cas(cas), exp).
         UpsertEx(xattrKey, xv, gocb.SubdocFlagXattr).          
         UpsertEx(xattrCasProperty, "${Mutation.CAS}", gocb.SubdocFlagXattr|gocb.SubdocFlagUseMacros) 
         mutateInBuilder.UpsertEx(xattrBodyHashProperty, "${Mutation.value_crc32c}", gocb.SubdocFlagXattr|gocb.SubdocFlagUseMacros) 
         mutateInBuilder.UpsertEx("", v, gocb.SubdocFlagNone), 
      }
      

       

        Attachments

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

          Activity

          Hide
          adamf Adam Fraser added a comment -

          The StoreSemantics flag can be used to set the SubdocDoc flags in the way SG used to be doing in V1, and that appears to address this issue.

          Thanks Charles Dixon for the info!

          Show
          adamf Adam Fraser added a comment - The StoreSemantics flag can be used to set the SubdocDoc flags in the way SG used to be doing in V1, and that appears to address this issue. Thanks Charles Dixon  for the info!

            People

            Assignee:
            charles.dixon Charles Dixon
            Reporter:
            adamf Adam Fraser
            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