Uploaded image for project: 'Couchbase Ruby client library'
  1. Couchbase Ruby client library
  2. RCBC-292

CAS inconsistent between n1ql and `get`

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0.3
    • 3.0.2
    • library
    • None
    • Linux x86_64, MRI 2.5
    • 1

    Description

      If I query my bucket with the key/value `get` API, I get a different CAS number than I I get in a N1QL query for the same document:

      SELECT META().cas, * FROM `test_bucket` WHERE name = 'Fibonacci';
      [
      {
        "cas": 1608614025244311552,
        "test_bucket": {
          "id": "de3f7b88-5d34-4bf1-bd57-532ea6b456d3",
          "luckyNumber": 11235,
          "name": "Fibonacci"
        }
      }

      vs: 

      cluster.bucket('test_bucket').default_collection.get('de3f7b88-5d34-4bf1-bd57-532ea6b456d3')
       
      #<Couchbase::Collection::GetResult:0x0000556c617e5838 @expiry=nil, @error=nil, @transcoder=#<Couchbase::JsonTranscoder:0x0000556c617e5950>, @cas=113129152401942, @flags=33554438, @encoded="{\"id\":\"de3f7b88-5d34-4bf1-bd57-532ea6b456d3\",\"name\":\"Fibonacci\",\"luckyNumber\":11235}">

      CAS from n1ql: 1608614025244311552
      CAS from `get`: 113129152401942

      In the old SDK (2.0 from GitHub), we got the same CAS number regardless of whether we used n1ql or `get`.

      Attachments

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

        Activity

          People

            avsej Sergey Avseyev
            kdt Ken Treis
            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