MemoryAdapter
Signature
export declare class MemoryAdapter<T> implements AdapterProperties
8Methods
19Properties
options: MemoryAdapterOptions<T>;isAsync: boolean;readonly storage: Map<string, Map<string, T>>;readonly keyToStorage: Map<string, string>;private _getStorageNamespace;private _getStorageEntry;private _set;private _getRelationshipKey;Methods
constructorConstructorconstructor(options?: MemoryAdapterOptions<T>);start(): void;scan(query: string, keys?: false): any[];scan(query: string, keys: true): string[];bulkGet(keys: string[]): unknown[];get(key: string): unknown;set(key: string, value: any, relationship: AdapterRelationship): void;Stores the value and relationship as one atomic operation.
bulkSet(entries: AdapterEntry[]): void;Stores every entry atomically. The batch itself is not atomic and implementations may execute entries concurrently or out of order. If the operation rejects, any subset may already be committed, but no writes remain pending after the returned promise settles.
patch(key: string, value: any, relationship: AdapterRelationship): void;Patches the value and stores its relationship as one atomic operation.
bulkPatch(entries: AdapterEntry[]): void;Patches every entry atomically. The batch itself is not atomic and implementations may execute entries concurrently or out of order. If the operation rejects, any subset may already be committed, but no writes remain pending after the returned promise settles.
values(to: string): any[];keys(to: string): string[];count(to: string): number;bulkRemove(keys: string[]): void;Removes every entry atomically. The batch itself is not atomic and implementations may execute entries concurrently or out of order. If the operation rejects, any subset may already be committed, but no removals remain pending after the returned promise settles.
remove(key: string): void;Removes the value and its owning relationship as one logical operation.
flush(): void;contains(to: string, id: string): boolean;getToRelationship(to: string): string[];removeToRelationship(to: string, keys: string | string[]): void;Removes the selected values and relationships owned by `to`.
removeRelationship(to: string | string[]): void;Removes every value and relationship owned by the supplied relationships.