gis-tools-ts - v0.6.0
    Preparing search index...

    Class S2MMapStore<V>

    NOTE: The File KVStore is designed to be used in states:

    • write-only. The initial state is write-only. Write all you need to before reading
    • read-only. Once you have written everything, the first read will lock the file to be static and read-only.

    Type Parameters

    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Builds a new File based KV

      Type Parameters

      Parameters

      • OptionalfileName: string

        the path + file name without the extension

      • Optionaloptions: MMapOptions

        the options of how the store should be created and ued

      Returns S2MMapStore<V>

    Accessors

    • get length(): number

      Returns number

      • the length of the store

    Methods

    • Closes the store

      Parameters

      • cleanup: boolean = false

        set to true if you want to remove the .keys and .values files upon closing

      Returns void

    • Iterates over all values in the store

      Parameters

      • bigint: boolean = false

        set to true if the value is a bigint stored in the index

      Returns AsyncIterableIterator<MMapEntry<V>>

      an iterator

    • Gets the value associated with a key

      Parameters

      • key: number | bigint

        the key

      • Optionalmax: number

        the max number of values to return

      • bigint: boolean = false

        set to true if the key is a bigint

      Returns Promise<undefined | V[]>

      the value if the map contains values for the key

    • Checks if the store contains a key

      Parameters

      • key: number | bigint

        the key

      Returns Promise<boolean>

      true if the store contains the key

    • Adds a value to be associated with a key

      Parameters

      • key: number | bigint

        the uint64 id

      • value: V

        the value to store

      Returns void

    • Sort the data if not sorted

      Returns Promise<void>