Subject: | string keys that consist of numbers |
Date: | Wed, 24 Nov 2010 16:36:29 +0100 |
To: | bug-CouchDB-Client [...] rt.cpan.org |
From: | Jiří Sedláček - Futu <jiri.sedlacek [...] futu.cz> |
Hi,
I just bumped into a problem with CouchDB::Client::DesignDoc. I emit
string keys in my view. Sometimes the string consists of numbers only
("1234"). If I query the view with argument key set from Perl, then it
fails because the quotes are missing.
Expected behavior:
GET to this URL is generated by CouchDB::Client::DesignDoc
http://localhost:5984/product-sovicka/_design/UserProduct/_view/cards?key='1234'
Observed behavior:
GET http://localhost:5984/product-sovicka/_design/UserProduct/_view/cards?key=1234
I dug a little and found out that the responsible lines of code are these:
lib/CouchDB/Client/DB.pm:245,246
unless ($args{$k} =~ /^\d+(?:\.\d+)*$/s) {
$args{$k} = '"' . $args{$k} . '"';
}
--
Jiří Sedláček - Futu Finance s.r.o. | jednatel | 604 290 544 |
www.futu.cz - Finance pod kontrolou