DB::CouchDB::Iter - a result iterator object for CouchDB views
Gives you some convenience functions for dealing with CouchDB view results
my $iter = $db->view($viewname); if ($rs->err) { die $rs->errstr; } while ( my $doc = $iter->next() ) { my $doc_id = $doc->{_id}; my %result = %$doc; } while ( my $doc = $iter->next_for_key($key) ) { my $doc_id = $doc->{_id}; my %result = %$doc; }
Returns the error from couchdb if there was an error.
Returns the error string from couchdb if there was an error.
Returns the record count returned for the view.
Returns the offset of the records returned.
Returns all the rows returned by the view.
Return the next row in the result set or undef if no more rows are left.
Returns the next key in the result set from a view. Does not return the results for that key though.
while ( my $result = $db->next_for_key($key) ) { ... # do something with the result }
Returns the next result for a key in the results for a view
To install DB::CouchDB::Schema, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DB::CouchDB::Schema
CPAN shell
perl -MCPAN -e shell install DB::CouchDB::Schema
For more information on module installation, please visit the detailed CPAN module installation guide.