LimitedMemoryAdapter
Signature
export declare class LimitedMemoryAdapter<T> implements AdapterProperties
23Methods
19Properties
isAsync: boolean;readonly storage: Map<string, LimitedCollection<string, T>>;readonly relationships: Map<string, Map<string, Set<string>>>;readonly keyToStorage: Map<string, LimitedMemoryStorageIndex<T>>;options: MakeRequired<LimitedMemoryAdapterOptions<T>, 'default' | 'encode' | 'decode'>;private _getKeyResource;private _hasScopedStorageKey;private _getIndexedStorage;private _deleteIndexedStorage;private _getStorageNamespaceFromKey;private _getMessageNamespace;private _getStorageEntry;private _getWithoutRefresh;private _getRelationshipData;private _getExplicitRelationshipSet;private _ensureExplicitRelationshipSet;private _removeExplicitRelationship;private _syncMessageRelationship;private _deleteEmptyStorage;private _createStorageEntry;private _set;private _getRelationshipBucket;private _getBucketKey;Methods
constructorConstructorconstructor(options?: LimitedMemoryAdapterOptions<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;contains(to: string, id: string): boolean;getToRelationship(to: string): string[];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.
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.
flush(): void;