in reply to Retrieving content from couchdb using CouchDB::Client
Is there a way to determine if newDoc might have failed to create the document? What is the result of running the following?
use warnings; use CouchDB::Client; my $c = CouchDB::Client->new(uri => 'http://127.0.0.1:5984/'); my $db = $c->newDB('test'); my ($doc) if ($db->docExists('12345')) { print "hello\n"; } else { $doc = $db->newDoc('12345', undef, {'foo'=>'bar'})->create; } print $doc->retrieve('12345');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Retrieving content from couchdb using CouchDB::Client
by shivam99aa (Novice) on Apr 23, 2015 at 15:39 UTC | |
by GotToBTru (Prior) on Apr 23, 2015 at 16:00 UTC | |
by shivam99aa (Novice) on Apr 23, 2015 at 18:14 UTC |