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

No INSERT SELECT Statement example

    XMLWordPrintable

Details

    Description

      Docs contain an example of INSERT VALUE, but not INSERT SELECT.
      This would be helpful as it's not immediately obvious what the syntax is, for example:

      INSERT INTO `newBucket` (KEY id, VALUE name) SELECT meta().id AS id, name FROM `beer-sample`;
      

      and, showing how to form correct JSON in the new document:

      INSERT INTO `newBucket` (KEY id, VALUE {"name":name}) SELECT meta().id AS id, name FROM `beer-sample`;
      

      Attachments

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

        Activity

          People

            amarantha.kulkarni Amarantha Kulkarni (Inactive)
            James Flather James Flather (Inactive)
            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