Subject: | POSTing a Document without setting an id fails |
When I create a document like this:
my $doc = Net::CouchDb::Document->new();
$doc->colours = [qw(blue green orange)];
Then post it with
$db->post($doc);
couchdb returns a 'bad request' error: 'Document id must be a string'.
Since the REST API creates a new ID for POSTed documents even if you
pass one into the POST request*, any ID should be removed (and
undef/null ID especially).
Patch attached is one possible fix (deletes undef _ids from the
document). I didn't take the extra step of removing any IDs from POSTed
documents.
*on couchdb 0.9.0
Subject: | patch-lib_Net_CouchDb_pm |
Message body not shown because it is not plain text.