Nicolas Steenlant > Catmandu-0.2 > Catmandu::Store::Hash

Download:
Catmandu-0.2.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: Catmandu-0.9206

NAME ^

Catmandu::Store::Hash - An in-memory Catmandu::Store

SYNOPSIS ^

   use Catmandu::Store::Hash;

   my $store = Catmandu::Store::Hash->new();

   my $obj1 = $store->bag->add({ name => 'Patrick' });

   printf "obj1 stored as %s\n" , $obj1->{_id};

   # Force an id in the store
   my $obj2 = $store->bag->add({ _id => 'test123' , name => 'Nicolas' });

   my $obj3 = $store->bag->get('test123');

   $store->bag->delete('test123');

   $store->bag->delete_all;

   # All bags are iterators
   $store->bag->each(sub { ... });
   $store->bag->take(10)->each(sub { ... });

DESCRIPTION ^

A Catmandu::Store::Hash is an in-memory Catmandu::Store backed by a hash for fast retrieval combined with a doubly linked list for fast traversal.

METHODS ^

new()

Create a new Catmandu::Store::Hash

bag($name)

Create or retieve a bag with name $name. Returns a Catmandu::Bag.

SEE ALSO ^

Catmandu::Bag, Catmandu::Searchable

syntax highlighting: