Class Keyed<GenericType>

Type Parameters

Hierarchy (View Summary)

Constructors

Properties

address: Muid
behavior: Behavior
database: Database
DELETION: Deletion = ...
globalPropertyMuid: { medallion: number; offset: Behavior; timestamp: number } = ...
INCLUSION: Inclusion = ...

Accessors

Methods

  • Adds a deletion marker (tombstone) for a particular key in the directory. The corresponding value will be seen to be unset in the data model.

    Parameters

    Returns Promise<Muid>

    a promise that resolves to the address of the newly created deletion entry

  • Reset this Container to a previous time. If no time is specified, the container will be cleared.

    Parameters

    • OptionaltoTime: AsOf
    • Optionalrecurse: any
    • Optionalmeta: Meta

    Returns Promise<void>

    toTime Optional time to reset to. If absent, the container will be cleared.

    recurse Recursively reset all child containers held by this container at reset time?

    meta Metadata to be used in the reset.

  • Reset the properties associated with this container to a previous time.

    Parameters

    • OptionaltoTime: AsOf

      optional timestamp to reset to. If not provided, the properties will be deleted.

    • Optionalmeta: Meta

    Returns Promise<void>

  • Sets a key/value association in a directory. If a bundler is supplied, the function will add the entry to that bundler and return immediately (you'll need to addBundler manually in that case). If the caller does not supply a bundler, then one is created on the fly, and then this method will await on the bundler being added to the database instance. This is to allow simple console usage like: await myDirectory.set("foo", "bar");

    Parameters

    Returns Promise<Muid>

    a promise that resolves to the address of the newly created entry

  • Generates a JSON representation of the data in this container. Mostly intended for demo/debug purposes.

    Parameters

    • indent: number | boolean = false

      true to pretty print

    • OptionalasOf: AsOf

      effective time

    • Optionalseen: Set<string>

      (internal use only! This prevents cycles from breaking things)

    Returns Promise<string>

    a JSON string

  • Dumps the contents of this directory into a javascript Map; mostly useful for debugging though also could be used to create a backup of a database.

    Parameters

    • OptionalasOf: AsOf

      effective time to get the dump for, or undefined for the present

    Returns Promise<Map<StorageKey, Value | Container>>

    a javascript map from keys (numbers or strings) to values or containers