feat: version 2 beta
This commit is contained in:
30
adapters/mongo/collections/snapshots.ts
Normal file
30
adapters/mongo/collections/snapshots.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import z from "zod";
|
||||
|
||||
import type { CollectionRegistrar } from "../types.ts";
|
||||
|
||||
export const registrar: CollectionRegistrar = {
|
||||
name: "snapshots",
|
||||
indexes: [
|
||||
[
|
||||
{
|
||||
name: 1,
|
||||
stream: 1,
|
||||
cursor: 1,
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
|
||||
export const schema = z.object({
|
||||
name: z.string(),
|
||||
stream: z.string(),
|
||||
cursor: z.string(),
|
||||
state: z.record(z.string(), z.any()),
|
||||
});
|
||||
|
||||
export type SnapshotSchema = {
|
||||
name: string;
|
||||
stream: string;
|
||||
cursor: string;
|
||||
state: Record<string, any>;
|
||||
};
|
||||
Reference in New Issue
Block a user