The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Redis::Object::SearchResult - Search result for Redis search

DESCRIPTION

Result of a search performed on a Redis database over which can be iterated.

DYNAMIC RESULT

Keep in mind, that a Redis::Object::SearchResult has to be viewed as a "dynamic filter", rather than a "fixed set". Iterating twice the same result can lead to different results. Simply put: don't do it.

SYNOPSIS

See Redis::Object

ATTRIBUTES

table

The table searching on

position

The current position, starting at 0.

METHODS

next

Returns the next item in the subset or undef

all

Returns all found items as an array.

reset

Reset to first position. Keep in mind, that a search result could have been changed in between, so iterating a second time can result in a different set of items.

    while( my $item = $result->next ) {
        # ..
    }
    $result->reset;
    whiel( my $item = $result->next ) {
        # ..
    }

update_all $update_ref

Update all items in the result

    my $result = $db->search( TableName => { .. } );
    $result->update_all( { attrib_name => $value } );

You need to reset the result afterwards, if you want to iterate over it again!

$update_ref

A hashref containing the data for update

remove_all

Delete all items in the result set.

Read the note about dynamic search results.

AUTHOR

Ulrich Kautz <uk@fortrabbit.de>

COPYRIGHT

Copyright (c) 2011 the "AUTHOR" as listed above

LICENCSE

Same license as Perl itself.