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

Missing documentation on filtering datasets on document metadata

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • None
    • 6.x Doc Updates
    • analytics
    • 1

    Description

      The following analytics doc page: https://docs.couchbase.com/server/6.0/analytics/5_ddl.html#Creating_and_dropping

      on creating and dropping datasets, provides syntax and examples onĀ filtering documents only based on fields in the document body.

      We can also filter dataset based on document metadata, although the syntax for filtering on metadata is not that straight-forward.

      The following example filters a dataset on document id:

      Bucket name: beer-sample

      Dataset name: brewery-name

      create dataset ` brewery-name` on `beer-sample` where meta(`beer-sample`).id like "21st%";
      

      Note that in N1QL while creating a Global Secondary Index, one does not need to give the bucket name as part of meta() function. However, we need to do so in Analytics only for Couchbase Server version 6.0.0.

      From version 6.5.0 and onwards, we will be fixing this syntax issue to just use meta().id instead of meta(`bucket-name`).id . This has been addressed as part of MB-32115 .

      Attachments

        Issue Links

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

          Activity

            People

              simon.dew Simon Dew
              abhishek.jindal Abhishek Jindal
              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