method KvTx.delete
Removes key when the transaction commits.
Example:
use std.kv { Kv, KvError }
fn main() io, db {
let kv = Kv.open("docs-kvtxdel")!
kv.put("k", b"v")!
let _ = kv.txn(tx => {
tx.delete("k")
})
match kv.get("k") {
bytes _ => print("still there")
none => print("gone")
KvError _ => print("error")
}
kv.close()
}Output
gone
pub(api) fn delete(key: str)Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
key | str |
Effects
none declared (pure unless the body says otherwise)
Defined in: std/kv/kv.oxl:727