---
name: "Catmandu::Store::AlephX"
section: "3pm"
platform: "linux"
package: "libcatmandu-alephx-perl"
version: "1.073-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Catmandu::Store::AlephX"
---

# Catmandu::Store::AlephX(3pm)

A Catmandu AlephX service implemented as Catmandu::Store

## NAME

Catmandu::Store::AlephX - A Catmandu AlephX service implemented as Catmandu::Store

## SYNOPSIS

```
 use Catmandu::Store::AlephX;
 my $store = Catmandu::Store::AlephX->new(url => 'http://aleph.ugent.be/X' , username => 'XXX' , password => 'XXX');
 $store->bag('usm01')->each(sub {
 });
```

## METHODS

### get($id)

Retrieves a record from the Aleph database. Requires a record identifier. Returns a Catmandu MARC record when found and undef on failure.

### add($catmandu\_marc)

Adds or updates a record to the Aleph database. Requires a Catmandu type MARC record and a \_id field containing the Aleph record number. This method with throw an error when an add cant be executed.

*example*

```
  #add new record. WARNING: Aleph will ignore the 001 field,
  my $new_record = eval {
    $bag->add({
    record =>  [
      [
        'FMT',
        '',
        '',
        '_',
        'SE'
      ],
      [
        'LDR',
        '',
        '',
        '_',
        '00000cas^^2200385^a^4500'
      ],
      [
        '001',
        '',
        '',
        '_',
        '000000444'
      ],
      [
        '005',
        '',
        '',
        '_',
        '20140212095615.0'
      ]
      ..
    ]
  });
  };
  if ($@) {
    die "add failed $@";
  }
  say "new record:".$record->{_id};
```

### delete($id)

Deletes a record from the Aleph database. Requires a record identifier. Returns a true value when the record is deleted.

### each(callback)

Loops over all records in the Aleph database executing callback for every record.

### search(query =\> $query, start =\> 0 , limit =\> 20);

### searcher()

Not implemented

### delete\_all()

Not implemented

### delete\_by\_query()

Not implemented

## SEE ALSO

Catmandu::Store
