Member visibility
Filter class members by access level.
KvCollection(
driver: KvDriver,
prefix: string,
updates: KeyedQueue
)TRecord
TRecordpublic entries(): AsyncIterable<
[id: string, record: Stored<TRecord>]
>Throws:
A SeedcordError when the backend can't list its keys, like @keyv/memcache.
Stores what next returns for the record under id, then resolves to that value. next gets
the current record, or undefined when there is none.
Use it over a get() then a set() when two calls can change one record at the same time.
set(), delete(), and update() calls on one id run one after the other in this process.
None of them loses another's change. Two processes sharing one backend can still both read
before either writes.
Parameter:
ttlMsHow many milliseconds the stored record lasts. Pass a function to work it out from the record. Leave it out to keep the record until you delete it.