📄 tanstack/db/latest/docs/reference/interfaces/CollectionLike

File: CollectionLike.md | Updated: 11/15/2025

Source: https://tanstack.com/db/latest/docs/reference/interfaces/CollectionLike



TanStack

DB v0v0

Search...

+ K

Auto

Log In

TanStack StartRC

Docs Examples GitHub Contributors

TanStack Router

Docs Examples GitHub Contributors

TanStack Query

Docs Examples GitHub Contributors

TanStack Table

Docs Examples Github Contributors

TanStack Formnew

Docs Examples Github Contributors

TanStack DBbeta

Docs Github Contributors

TanStack Virtual

Docs Examples Github Contributors

TanStack Paceralpha

Docs Examples Github Contributors

TanStack Storealpha

Docs Examples Github Contributors

TanStack Devtoolsalpha

Docs Github Contributors

More Libraries

Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide

Documentation

Framework

React logo

React

Version

Latest

Search...

+ K

Menu

Getting Started

Guides

Collections

Frameworks

Community

API Reference

Framework

React logo

React

Version

Latest

Menu

Getting Started

Guides

Collections

Frameworks

Community

API Reference

On this page

CollectionLike

Copy Markdown

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

Edit on GitHub

Home

Partners Become a Partner

Code RabbitCode Rabbit CloudflareCloudflare AG GridAG Grid NetlifyNetlify NeonNeon WorkOSWorkOS ClerkClerk ConvexConvex ElectricElectric SentrySentry PrismaPrisma StrapiStrapi UnkeyUnkey

scarf analytics