@@ -5,7 +5,7 @@ title: CollectionConfig
55
66# Interface: CollectionConfig\< T, TKey, TSchema, TUtils\>
77
8- Defined in: [ packages/db/src/types.ts:646 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L646 )
8+ Defined in: [ packages/db/src/types.ts:649 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L649 )
99
1010## Extends
1111
@@ -37,7 +37,7 @@ Defined in: [packages/db/src/types.ts:646](https://github.com/TanStack/db/blob/m
3737optional autoIndex : " eager" | " off" ;
3838```
3939
40- Defined in: [ packages/db/src/types.ts:484 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L484 )
40+ Defined in: [ packages/db/src/types.ts:487 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L487 )
4141
4242Auto-indexing mode for the collection.
4343When enabled, indexes will be automatically created for simple where expressions.
@@ -65,7 +65,7 @@ When enabled, indexes will be automatically created for simple where expressions
6565optional compare : (x , y ) => number ;
6666```
6767
68- Defined in: [ packages/db/src/types.ts:495 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L495 )
68+ Defined in: [ packages/db/src/types.ts:498 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L498 )
6969
7070Optional function to compare two items.
7171This is used to order the items in the collection.
@@ -109,7 +109,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime()
109109optional defaultStringCollation : StringCollationConfig ;
110110```
111111
112- Defined in: [ packages/db/src/types.ts:641 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L641 )
112+ Defined in: [ packages/db/src/types.ts:644 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L644 )
113113
114114Specifies how to compare data in the collection.
115115This should be configured to match data ordering on the backend.
@@ -128,7 +128,7 @@ E.g., when using the Electric DB collection these options
128128optional gcTime : number ;
129129```
130130
131- Defined in: [ packages/db/src/types.ts:464 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L464 )
131+ Defined in: [ packages/db/src/types.ts:467 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L467 )
132132
133133Time in milliseconds after which the collection will be garbage collected
134134when it has no active subscribers. Defaults to 5 minutes (300000ms).
@@ -145,7 +145,7 @@ when it has no active subscribers. Defaults to 5 minutes (300000ms).
145145getKey : (item ) => TKey ;
146146```
147147
148- Defined in: [ packages/db/src/types.ts:459 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L459 )
148+ Defined in: [ packages/db/src/types.ts:462 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L462 )
149149
150150Function to extract the ID from an object
151151This is required for update/delete operations which now only accept IDs
@@ -183,7 +183,7 @@ getKey: (item) => item.uuid
183183optional id : string ;
184184```
185185
186- Defined in: [ packages/db/src/types.ts:448 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L448 )
186+ Defined in: [ packages/db/src/types.ts:451 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L451 )
187187
188188#### Inherited from
189189
@@ -197,7 +197,7 @@ Defined in: [packages/db/src/types.ts:448](https://github.com/TanStack/db/blob/m
197197optional onDelete : DeleteMutationFn < T , TKey , TUtils , any > ;
198198```
199199
200- Defined in: [ packages/db/src/types.ts:633 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L633 )
200+ Defined in: [ packages/db/src/types.ts:636 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L636 )
201201
202202Optional asynchronous handler function called before a delete operation
203203
@@ -265,7 +265,7 @@ onDelete: async ({ transaction, collection }) => {
265265optional onInsert : InsertMutationFn < T , TKey , TUtils , any > ;
266266```
267267
268- Defined in: [ packages/db/src/types.ts:546 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L546 )
268+ Defined in: [ packages/db/src/types.ts:549 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L549 )
269269
270270Optional asynchronous handler function called before an insert operation
271271
@@ -332,7 +332,7 @@ onInsert: async ({ transaction, collection }) => {
332332optional onUpdate : UpdateMutationFn < T , TKey , TUtils , any > ;
333333```
334334
335- Defined in: [ packages/db/src/types.ts:590 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L590 )
335+ Defined in: [ packages/db/src/types.ts:593 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L593 )
336336
337337Optional asynchronous handler function called before an update operation
338338
@@ -400,7 +400,7 @@ onUpdate: async ({ transaction, collection }) => {
400400optional schema : TSchema ;
401401```
402402
403- Defined in: [ packages/db/src/types.ts:449 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L449 )
403+ Defined in: [ packages/db/src/types.ts:452 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L452 )
404404
405405#### Inherited from
406406
@@ -414,7 +414,7 @@ Defined in: [packages/db/src/types.ts:449](https://github.com/TanStack/db/blob/m
414414optional startSync : boolean ;
415415```
416416
417- Defined in: [ packages/db/src/types.ts:475 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L475 )
417+ Defined in: [ packages/db/src/types.ts:478 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L478 )
418418
419419Whether to eagerly start syncing on collection creation.
420420When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches.
@@ -441,7 +441,7 @@ false
441441sync : SyncConfig < T , TKey > ;
442442```
443443
444- Defined in: [ packages/db/src/types.ts:652 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L652 )
444+ Defined in: [ packages/db/src/types.ts:655 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L655 )
445445
446446***
447447
@@ -451,7 +451,7 @@ Defined in: [packages/db/src/types.ts:652](https://github.com/TanStack/db/blob/m
451451optional syncMode : SyncMode ;
452452```
453453
454- Defined in: [ packages/db/src/types.ts:504 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L504 )
454+ Defined in: [ packages/db/src/types.ts:507 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L507 )
455455
456456The mode of sync to use for the collection.
457457
@@ -477,7 +477,7 @@ The exact implementation of the sync mode is up to the sync implementation.
477477optional utils : TUtils ;
478478```
479479
480- Defined in: [ packages/db/src/types.ts:643 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L643 )
480+ Defined in: [ packages/db/src/types.ts:646 ] ( https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L646 )
481481
482482#### Inherited from
483483
0 commit comments