Details
-
Bug
-
Resolution: Won't Fix
-
Major
-
None
-
6.x Doc Updates
-
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
- depends on
-
MB-32115 Analytics: Unable to filter Dataset on document keys
- Closed