shivam99aa has asked for the wisdom of the Perl Monks concerning the following question:
I am able to create new documents using CouchDB::Client as well as able to verify if any doc is present. What i am not able to do is to retrieve the contents of any doc. The reason is i am not able to get the correct syntax which is to be used for it. I am not a perl genius so taking a look at the source code did not help me either.
use warnings; use CouchDB::Client; my $c = CouchDB::Client->new(uri => 'http://127.0.0.1:5984/'); my $db = $c->newDB('test'); my $doc = $db->newDoc('12345', undef, {'foo'=>'bar'})->create; if ($db->docExists('12345')){ print "hello\n"; } #my $doc=CouchDB::Client::Doc->new($db); print $doc->retrieve('12345');
I am able to create document but then i need to comment that line on next run as this will give storage error. But after commenting i have no way to retrieve the doc as i have no object remaining. But this should not be the constraint as there should be a way to retrieve doc using the db object by giving id to it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Retrieving content from couchdb using CouchDB::Client
by ww (Archbishop) on Apr 23, 2015 at 14:26 UTC | |
|
Re: Retrieving content from couchdb using CouchDB::Client
by GotToBTru (Prior) on Apr 23, 2015 at 14:15 UTC | |
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 | |
|
Re: Retrieving content from couchdb using CouchDB::Client
by SimonPratt (Friar) on Apr 24, 2015 at 14:12 UTC |