diff options
Diffstat (limited to 'lib/Net/Riak.pm')
| -rw-r--r-- | lib/Net/Riak.pm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/Net/Riak.pm b/lib/Net/Riak.pm index d4f8ef9..1fd23a6 100644 --- a/lib/Net/Riak.pm +++ b/lib/Net/Riak.pm @@ -14,7 +14,7 @@ has client => ( is => 'rw', isa => Client_T, required => 1, - handles => [qw/is_alive all_buckets server_info stats search setup_indexing/] + handles => [qw/is_alive all_buckets server_info stats search index setup_indexing/] ); sub BUILDARGS { @@ -66,6 +66,23 @@ sub bucket { q => 'field:value' ); + # Secondary index setup (REST interface) + my $obj3 = $bucket->new_object('foo3', {...}); + $obj3->add_index('myindex_bin','myvalue' ); + $obj3->add_index('number_int', 1001); + $obj3->store; + + # Get all keys for a specific index/value pair + my @keys = $client->index('mybucket', 'myindex_bin', 'myvalue' ); + + # Get all keys for a range of index value pairs + my @keys = $client->index('mybucket', 'number_int', 500, 1500); + + # Removing a secondary index (REST interface) + my $new_obj = $bucket->get('foo3'); + $new_obj->remove_index('number_int', 1001); + $new_obj->store; + =head1 DESCRIPTION =head2 ATTRIBUTES |
