Optionaloptions: LevelDBOptionsCloses the database.
Resolves when the database has been opened.
Optionaloptions: OpOptsOptionaloptions: OpOptsOpens the database.
Resolves when the database has been opened.
Staticdestroydestroy() is used to completely remove an existing LevelDB database directory. You can use this function in place of a full directory rm if you want to be sure to only remove LevelDB-related files. If the directory only contains LevelDB files, the directory itself will be removed as well. If there are additional, non-LevelDB files in the directory, those files, and the directory, will be left alone. The callback will be called when the destroy operation is complete, with a possible error argument.
Staticrepairrepair() can be used to attempt a restoration of a damaged LevelDB store. From the LevelDB documentation:
If a DB cannot be opened, you may attempt to call this method to resurrect as much of the contents of the database as possible. Some data may be lost, so be careful when calling this function on a database that contains important information.
You will find information on the repair operation in the LOG file inside the store directory.
A repair() can also be used to perform a compaction of the LevelDB log into table files.
StaticserializeStaticserialize
Delete all entries or a range.