@ethereumjs/util / MapDB
Name | Type |
---|---|
TKey |
extends Uint8Array | string | number |
TValue |
extends Uint8Array | string | DBObject |
DB
<TKey
, TValue
>• new MapDB<TKey
, TValue
>(database?
)
Name | Type |
---|---|
TKey |
extends string | number | Uint8Array |
TValue |
extends string | Uint8Array | DBObject |
Name | Type |
---|---|
database? |
Map <TKey , TValue > |
• _database: Map
<TKey
, TValue
>
▸ batch(opStack
): Promise
<void
>
Performs a batch operation on db.
Name | Type | Description |
---|---|---|
opStack |
BatchDBOp <TKey , TValue >[] |
A stack of levelup operations |
Promise
<void
>
▸ del(key
): Promise
<void
>
Removes a raw value in the underlying db.
Name | Type |
---|---|
key |
TKey |
Promise
<void
>
▸ get(key
): Promise
<undefined
| TValue
>
Retrieves a raw value from db.
Name | Type |
---|---|
key |
TKey |
Promise
<undefined
| TValue
>
A Promise that resolves to Uint8Array
if a value is found or undefined
if no value is found.
▸ open(): Promise
<void
>
Opens the database – if applicable
Promise
<void
>
▸ put(key
, val
): Promise
<void
>
Writes a value directly to db.
Name | Type | Description |
---|---|---|
key |
TKey |
The key as a TValue |
val |
TValue |
- |
Promise
<void
>
▸ shallowCopy(): DB
<TKey
, TValue
>
Note that the returned shallow copy will share the underlying database with the original
DB
<TKey
, TValue
>
DB