Skip to content
Jens Alfke edited this page Jul 24, 2014 · 2 revisions

Access Tool

The forestdb_dump tool provides various ways to read ForestDB database instances. For more details, running forestdb_dump without any parameters shows the supported options. The following show some typical examples for running this tool:

  • Retrieve a specific key, metadata, and value
$ ./forestdb_dump --key 'yyywxlljkgynhfcfukjdwomqjirkaocv' test.fdb
DB header info:
    BID: 12813 (0x320d, byte offset: 52482048)
    DB header length: 566 bytes
    ...

Doc ID: yyywxlljkgynhfcfukjdwomqjirkaocv
    Sequence number: 141594
    Byte offset: 33270890
    Indexed by the main index
    Length: 32 (key), 32 (metadata), 100 (body)
    Status: normal
    Metadata: (hex)
        68 75 6a 78 61 75 79 6e  6f 6b 6a 70 71 71 6f 77   hujxauynokjpqqow
        70 6d 64 69 6d 73 63 66  76 6f 71 6c 6f 67 75 6c   pmdimscfvoqlogul
    Body: [D8W$'WmA}6_V)$]caLlylGS]R9(GVqHh<*Yu]7:m./92@"3Y5vwx/W`S{>GabbK5H;k3ud-h\;,U5UvM-%Q{v7W510:s&&0J9i.
  • Retrieve all the keys, their metadata, and values in ascending key order
$ ./forestdb_dump --byid test.fdb
DB header info:
    BID: 12813 (0x320d, byte offset: 52482048)
    DB header length: 566 bytes
    ...

Doc ID: aaaffnehwjmtviirifjatvnwtkeliyog
    Sequence number: 82283
    Byte offset: 16135306
    ...

Doc ID: aaakgaaxatvvjpaigpmpvtvohkjqisey
    Sequence number: 113642
    Byte offset: 27790960
    ...
  • Retrieve all the keys, their metadata, and values in ascending sequence (chronological) order
$ ./forestdb_dump --byseq test.fdb
DB header info:
    BID: 12813 (0x320d, byte offset: 52482048)
    DB header length: 566 bytes
    ...

Doc ID: ccyeufkwouxkbmgvylyecsetqttdbpcl
    Sequence number: 50001
    Byte offset: 9806489
    ...

Doc ID: fmkpqxdxlkfwfufdwnefhkqtmkqkghja
    Sequence number: 50002
    Byte offset: 9806685
    ...
Clone this wiki locally