Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-1193

mutateIn with a MutateInMacro instance throws an error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.2.11
    • 4.2.6
    • library
    • None
    • Local machine
      macOS 13
      Couchbase Entreprise 7.1.3
    • 1
    • SDK06: FIT, PS, CXX, SDK08: SDK3.5, 0xD, FtrNA, PS

    Description

      Sub-document mutation fail when a `MutateInMacro` is given as a value.

      connect('couchbase://127.0.0.1', options).then(async (cluster) => {
        const s = cluster.bucket('test').defaultScope();
        const c = cluster.bucket('test').defaultCollection();
       
        await c.upsert('test__doc', {
          title: 'hello'
        });
       
        const { content } = await c.mutateIn('test__doc', [
          MutateInSpec.upsert('title', MutateInMacro.Cas), // Error - xattr_invalid_key_combo - EXPAND_MACROS flag requires XATTR flag to be set
          MutateInSpec.upsert('title', MutateInMacro.Cas, { xattr: true }), // Error - xattr_unknown_macro
          MutateInSpec.upsert('title', '${document.CAS}'), // OK
          MutateInSpec.upsert('title', '${document.CAS}', { xattr: true }), // OK
        ]);
       
      }).catch(err => console.log(err));

       
       

      Attachments

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

        Activity

          People

            jared.casey Jared Casey
            JesusTheHun Jonathan MASSUCHETTI
            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