Open History to see the last commit
1---
2id: PendingMutation
3title: PendingMutation
4---
5
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7
8# Interface: PendingMutation\<T, TOperation, TCollection\>
9
10Defined in: [packages/db/src/types.ts:103](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L103)
11
12Represents a pending mutation within a transaction
13Contains information about the original and modified data, as well as metadata
14
15## Type Parameters
16
17• **T** *extends* `object` = `Record`\<`string`, `unknown`\>
18
19• **TOperation** *extends* [`OperationType`](../../type-aliases/operationtype.md) = [`OperationType`](../../type-aliases/operationtype.md)
20
21• **TCollection** *extends* [`Collection`](../collection.md)\<`T`, `any`, `any`, `any`, `any`\> = [`Collection`](../collection.md)\<`T`, `any`, `any`, `any`, `any`\>
22
23## Properties
24
25### changes
26
27```ts
28changes: ResolveTransactionChanges<T, TOperation>;
29```
30
31Defined in: [packages/db/src/types.ts:120](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L120)
32
33***
34
35### collection
36
37```ts
38collection: TCollection;
39```
40
41Defined in: [packages/db/src/types.ts:131](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L131)
42
43***
44
45### createdAt
46
47```ts
48createdAt: Date;
49```
50
51Defined in: [packages/db/src/types.ts:129](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L129)
52
53***
54
55### globalKey
56
57```ts
58globalKey: string;
59```
60
61Defined in: [packages/db/src/types.ts:121](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L121)
62
63***
64
65### key
66
67```ts
68key: any;
69```
70
71Defined in: [packages/db/src/types.ts:123](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L123)
72
73***
74
75### metadata
76
77```ts
78metadata: unknown;
79```
80
81Defined in: [packages/db/src/types.ts:125](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L125)
82
83***
84
85### modified
86
87```ts
88modified: T;
89```
90
91Defined in: [packages/db/src/types.ts:118](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L118)
92
93***
94
95### mutationId
96
97```ts
98mutationId: string;
99```
100
101Defined in: [packages/db/src/types.ts:114](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L114)
102
103***
104
105### optimistic
106
107```ts
108optimistic: boolean;
109```
110
111Defined in: [packages/db/src/types.ts:128](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L128)
112
113Whether this mutation should be applied optimistically (defaults to true)
114
115***
116
117### original
118
119```ts
120original: TOperation extends "insert" ? object : T;
121```
122
123Defined in: [packages/db/src/types.ts:116](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L116)
124
125***
126
127### syncMetadata
128
129```ts
130syncMetadata: Record<string, unknown>;
131```
132
133Defined in: [packages/db/src/types.ts:126](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L126)
134
135***
136
137### type
138
139```ts
140type: TOperation;
141```
142
143Defined in: [packages/db/src/types.ts:124](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L124)
144
145***
146
147### updatedAt
148
149```ts
150updatedAt: Date;
151```
152
153Defined in: [packages/db/src/types.ts:130](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L130)