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

Update server examples with scopes and collections



    • DOC-2021-Feb28-S4, DOC-2021-Mar14-S5, DOC-2021-Mar28-S6, DOC-2021-Apr11-S7, DOC-2021-Apr25-S8, DOC-2021-May09-S9, DOC-2021-May23-S10, DOC-2021-Jun06-S11, DOC-2021-Jun20-S12, DOC-2021-Jul04-S13, DOC-2021-Jul18-S14, DOC-2021-Aug01-S15, DOC-2021-Aug15-S16, DOC-2021-Aug29-S17, DOC-2021-Sep12-S18, DOC-2021-Sep26-S19, DOC-2021-Oct10-S20, DOC-2021-Oct24-S21, DOC-2021-Nov07-S22, DOC-2021-Nov21-S23, DOC-2021-Dec05-S24, DOC-2021-Dec19-S25, DOC-2021-Dec31-S26, DOC-2022-S1, DOC-2022-S2, DOC-2022-S3, DOC-2022-S4
    • 1


      When new sample buckets become available with scopes and collections, update the N1QL examples to make use of them where appropriate.

      The travel-sample bucket is being updated so that all existing records will be stored within a scope called inventory. Within that scope, there will be five collections: airport, hotel, landmark, airline, route. Each flavor of record (as distinguished by the type field) is now stored within its own proper collection. (Note that each record will still contain the type field, even though it is hardly needed any more.)

      For the beta refresh, N1QL examples need to be updated as follows:

      1. All examples must use `travel-sample`.scope.collection rather than `travel-sample` — except for those cases where we are demonstrating query context, in which case the example must use collection.
      2. Any queries which filter on type should remove the filter. If necessary, replace with a filter on some other field — see note below.
      3. Use judgement to ensure that examples still illustrate the concept that they are intended to.

      So, for example:

      SELECT * FROM `travel-sample` WHERE type = "airport" AND country = "France";

      Would become something like:

      SELECT * FROM `travel-sample`.inventory.airport WHERE country = "France";

      Note: If you need to demonstrate filtering different "flavors" of document, e.g. to create a partial index, use the activity field in the landmark collection.


        Issue Links

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



              simon.dew Simon Dew
              simon.dew Simon Dew
              0 Vote for this issue
              3 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes