Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.1.0-dp5
-
Fix Version/s: 1.1.0
-
Component/s: None
-
Security Level: Public
-
Labels: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".
$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".
Activity
- All
- Comments
- Work Log
- History
- Activity
- Gerrit Reviews
Matt Ingenthron
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Matt Ingenthron [ ingenthr ] | Mark Nunberg [ mnunberg ] |
Matt Ingenthron
made changes -
| Summary | Character strings of decimal digits are serialised over the REST API as integers | 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 |
| Assignee | Mark Nunberg [ mnunberg ] | Michael Nitschinger [ daschl ] |
| Fix Version/s | 1.1.0-beta [ 10403 ] | |
| Affects Version/s | 1.1.0-dp5 [ 10393 ] | |
| Priority | Major [ 3 ] | Blocker [ 1 ] |
Michael Nitschinger
made changes -
| Assignee | Michael Nitschinger [ daschl ] | Matt Ingenthron [ ingenthr ] |
Mark Nunberg
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Matt Ingenthron
made changes -
| Fix Version/s | 1.1.0 [ 10242 ] | |
| Fix Version/s | 1.1.0-beta [ 10403 ] |