tensorstore.KvStore.delete_range(self, range: KvStore.KeyRange) Future[None]

Deletes a key range.

Example

>>> store = await ts.KvStore.open({'driver': 'memory'})
>>> await store.write(b'a', b'value')
>>> await store.write(b'b', b'value')
>>> await store.write(b'c', b'value')
>>> await store.list()
[b'a', b'b', b'c']
>>> await store.delete_range(ts.KvStore.KeyRange(b'aa', b'cc'))
>>> await store.list()
[b'a']
Parameters:
range: KvStore.KeyRange

Key range to delete. This is relative to the existing path, if any.

Returns:

  • If no transaction is specified, returns a Future that becomes ready when the delete operation has completed and durability is guaranteed (to the extent supported by the driver).

  • If a transaction is specified, returns a Future that becomes ready when the delete operation is recorded in the transaction. The delete operation is not actually performed until the transaction is committed.