Redis::Object::SearchResult - Search result for Redis search
Result of a search performed on a Redis database over which can be iterated.
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.
See Redis::Object
The table searching on
The current position, starting at 0.
Returns the next item in the subset or undef
Returns all found items as an array.
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 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!
A hashref containing the data for update
Delete all items in the result set.
Read the note about dynamic search results.
Ulrich Kautz <uk@fortrabbit.de>
Copyright (c) 2011 the "AUTHOR" as listed above
Same license as Perl itself.
To install Redis::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Redis::Object
CPAN shell
perl -MCPAN -e shell install Redis::Object
For more information on module installation, please visit the detailed CPAN module installation guide.