NAME

Couch::DB::Row - a single row of a page

SYNOPSIS

my $list = $db->allDocs({include_docs => 1}, _all => 1);
my @rows = $list->page;
my @docs = map $_->doc, @rows;

foreach my $row (@rows)
{   printf "page %3d item %4d: %s\n",
       $row->pageNumber,
       $row->rowNumberInPage,
       $row->doc->{name};
}

DESCRIPTION

Many command can page their answers. The resulting rows are each wrapped in this object for nicer abstraction of the data structures.

METHODS

Constructors

Couch::DB::Row->new(%options)
-Option--Default
 answer  <required>
 doc     undef
 result  <required>
 rownr   <required>
 values  undef
answer => JSON

The JSON structure from the result which represents this row.

doc => Couch::DB::Document-object
result => Couch::DB::Result

The result-object which contains this row.

rownr => INTEGER

The location of this row in the result. Starts at 1.

values => HASH

The answer about this row converted to Perl data types. Default to the answer.

Accessors

$obj->answer()

The JSON fragment from the result answer which contains the information about this row.

$obj->doc()

In case the response contains a document structure (you may need to use include_docs in the query), then this method will return a Couch::DB::Document object.

$obj->result()

The Couch::DB::Result structure which contained this row. Within one page, this may be different for different rows.

$obj->values()

The answer about this row, translated into Perl data types.

Paging

$obj->pageNumber()
$obj->rowNumberInPage()
$obj->rowNumberInResult()
$obj->rowNumberInSearch()

SEE ALSO

This module is part of Couch-DB distribution version 0.200, built on June 18, 2025. Website: http://perl.overmeer.net/CPAN/

LICENSE

Copyrights 2024-2025 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/