Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-137

view querying needs to be more straightforward; e.g. character strings of decimal digits are serialised over the REST API as integers in view requests

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 1.1.0
    • 1.1.0-dp5
    • None
    • Security Level: Public
    • None

    Description

      Given this code:

      $key = "1";
      $result = $cb->view("design", "view", array("key"=>$key));

      The PHP library will serialize this to a REST request as follows:

      GET /bucket/_design/design/_view/view?key=1

      This will be deserialized by couchbase as the integer value 1, not as the string value "1". Consequently, any key that is a string of decimal digits cannot be retrieved from a view with the PHP library.

      This workaround can be used:

      $key = "1";
      $result = $cb->view("design", "view", array("key"=>'"'.$key.'"'));

      The library will serialize this to a REST request as follows:

      GET /bucket/_design/design/_view/view?key="1"

      And couchbase will deserialize this as the string value "1".

      Attachments

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

        Activity

          People

            ingenthr Matt Ingenthron
            michael8robinson Michael Robinson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty