Search code examples
node.jsin-memory-databaseleveldb

How to persist level db data on local file system or any other database


I am working nodejs application which uses LevelDb. LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.

Whenever I restart the application server, levelDB data removed from memory. I want to persist LevelDB data on local file system or any other database so that for every startup service of server will get that data.


Solution

  • Just use --path <path> in cli mode,

    Or {path: './mydb'} programmatically

    It's all here