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

N1QL Sample where clause dont match sample data

    XMLWordPrintable

Details

    Description

      Queries in this section don't match data in the `travel-sample` bucket. Example - SELECT meta().id
      FROM `travel-sample` USE INDEX (USING FTS)
      WHERE type = "hotel" AND country = "UNITED STATES" OR country = "CANADA";

      This returns no result. Data in bucket have pattern "United States" and "Canada"

      Should be SELECT meta().id
      FROM `travel-sample` USE INDEX (USING FTS)
      WHERE type = "hotel" AND UPPER(country) = "UNITED STATES" OR upper(country) = "CANADA";

      or

      SELECT meta().id
      FROM `travel-sample` USE INDEX (USING FTS)
      WHERE type = "hotel" AND country = "United States" OR country = "Canada";

      The second example is more performant

      Reporter: Tim Wong
      E-mail: tim.wong@couchbase.com

      Attachments

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

        Activity

          People

            simon.dew Simon Dew
            tim.wong Tim Wong
            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