Skip to content

Commit 83f33c8

Browse files
committed
Fix optional
1 parent e475b54 commit 83f33c8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/docs/cache.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,19 @@ You can also use cache instance from a `db` to invalidate specific tables or tag
168168

169169
```ts
170170
// Invalidate all queries that use the `users` table. You can do this with the Drizzle instance.
171-
await db.$cache?.invalidate({ tables: users });
171+
await db.$cache.invalidate({ tables: users });
172172
// or
173-
await db.$cache?.invalidate({ tables: [users, posts] });
173+
await db.$cache.invalidate({ tables: [users, posts] });
174174

175175
// Invalidate all queries that use the `usersTable`. You can do this by using just the table name.
176-
await db.$cache?.invalidate({ tables: "usersTable" });
176+
await db.$cache.invalidate({ tables: "usersTable" });
177177
// or
178-
await db.$cache?.invalidate({ tables: ["usersTable", "postsTable"] });
178+
await db.$cache.invalidate({ tables: ["usersTable", "postsTable"] });
179179

180180
// You can also invalidate custom tags defined in any previously executed select queries.
181-
await db.$cache?.invalidate({ tags: "custom_key" });
181+
await db.$cache.invalidate({ tags: "custom_key" });
182182
// or
183-
await db.$cache?.invalidate({ tags: ["custom_key", "custom_key1"] });
183+
await db.$cache.invalidate({ tags: ["custom_key", "custom_key1"] });
184184
```
185185

186186
## Custom cache

0 commit comments

Comments
 (0)