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

Create tutorial for transactions in N1QL

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • Cheshire-Cat
    • Cheshire-Cat
    • query
    • DOC-2021-Apr11-S7, DOC-2021-Apr25-S8, DOC-2021-May09-S9
    • 1

    Description

      Create complete walkthrough of an entire transactions session in N1QL.

      For example:

      cbq> BEGIN WORK;
      cbq> INSERT INTO test VALUES("abc2", {"a":1});
      cbq> SAVEPOINT s1;
      cbq> UPDATE test AS d SET d.b = 10 WHERE d.a > 0;
      cbq> SELECT d.*, META(d).id FROM test AS d WHERE d.a >= 0;
      cbq> SAVEPOINT s2;
      cbq> UPDATE test AS d SET d.b = 10, d.c = "xyz" WHERE d.a > 0;
      cbq> SELECT d.*, META(d).id FROM test AS d WHERE d.a >= 0;
      cbq> ROLLBACK TRAN TO SAVEPOINT s2;
      cbq> SELECT d.*, META(d).id FROM test AS d WHERE d.a >= 0;
      cbq> ROLLBACK WORK;
      

      Attachments

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

        Activity

          People

            simon.dew Simon Dew
            simon.dew Simon Dew
            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