CollectionLike

Interface: CollectionLike<T, TKey>

Defined in: packages/db/src/types.ts:12

Interface for a collection-like object that provides the necessary methods for the change events system to work

Extends

  • Pick<Collection<T, TKey>, "get" | "has" | "entries" | "indexes" | "id" | "compareOptions">

Type Parameters

T

T extends object = Record<string, unknown>

TKey

TKey extends string | number = string | number

Properties

compareOptions

ts
compareOptions: StringCollationConfig;
compareOptions: StringCollationConfig;

Defined in: packages/db/src/collection/index.ts:516

Inherited from

CollectionImpl.compareOptions


id

ts
id: string;
id: string;

Defined in: packages/db/src/collection/index.ts:210

Inherited from

CollectionImpl.id


indexes

ts
indexes: Map<number, BaseIndex<TKey>>;
indexes: Map<number, BaseIndex<TKey>>;

Defined in: packages/db/src/collection/index.ts:501

Inherited from

ts
Pick.indexes
Pick.indexes

Methods

entries()

ts
entries(): IterableIterator<[TKey, T]>;
entries(): IterableIterator<[TKey, T]>;

Defined in: packages/db/src/collection/index.ts:425

Get all entries (virtual derived state)

Returns

IterableIterator<[TKey, T]>

Inherited from

ts
Pick.entries
Pick.entries

get()

ts
get(key): T | undefined;
get(key): T | undefined;

Defined in: packages/db/src/collection/index.ts:390

Get the current value for a key (virtual derived state)

Parameters

key

TKey

Returns

T | undefined

Inherited from

ts
Pick.get
Pick.get

has()

ts
has(key): boolean;
has(key): boolean;

Defined in: packages/db/src/collection/index.ts:397

Check if a key exists in the collection (virtual derived state)

Parameters

key

TKey

Returns

boolean

Inherited from

ts
Pick.has
Pick.has
Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.

Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.