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

remove under txn not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • None
    • None
    • None
    • None
    • 1

    Description

      Scenario is that under a KV get()/remove() with transactions, I later check in the UI and the doc is still there, but it should not be since the txn completed without errors.

      Oddly, under the client, all that is logged is the txn attempt and a subsequent non-transactional get does fail. Checking with cbc shows it's still there.

      async function remove() {
        let cluster = await getCluster()
        let collection = await getCollection()
        // tag::remove[]
        cluster.transactions().run(async ctx => {
          const doc = await ctx.get(collection, "doc-id")
          await ctx.remove(doc)
        })
        // end::remove[]
        console.log("removeā€¦")
      }
      

      I suspect it's something I'm getting wrong with my awaits, but I can't figure out what at the moment.

      Attachments

        Issue Links

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

          Activity

            People

              ingenthr Matt Ingenthron
              ingenthr Matt Ingenthron
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty