Subject: | Synopsis code in main man page doesn't work against couchdb 0.9.0 |
Running the code from Net::CouchDB man page, viz.:
use Net::CouchDb;
my $cdb = Net::CouchDb->new(host => "localhost", port => 5984);
$cdb->debug(1);
$cdb->create_db("test");
my $test = $cdb->db("test");
my $doc = Net::CouchDb::Document->new;
$doc->colours = [qw(blue green orange)];
$test->put($doc);
produces an error from putting a document (an update) without an id:
Use of uninitialized value $uri in concatenation (.) or string at
/usr/local/libdata/perl5/site_perl/Net/CouchDb/Database.pm line 151.
"{\"error\":\"file_exists\",\"reason\":\"The database could not be
created, the file already exists.\"}\n",
) at /usr/local/libdata/perl5/site_perl/Net/CouchDb.pm line 185.
Net::CouchDb is attempting to update the document without an ID and it
gets interpreted as a PUT to create a new database.