At this stage, we use$dateToStringthe aggregation pipeline operator to convert the specifieddateobject into a string as per the specified format and save it in_idthe field, which is further used to group the do
string(), proxyId: zUUID().refPath("proxy"), proxy: z.string(), }); Validation You can use zod refinement to validate your mongoose models: import { z } from "zod"; import { extendZod, zodSchema } from "@zodyac/zod-mongoose"; extendZod(z); const zUser = z.object({ phone:...
You can usezId(ref?: string)andzUUID(ref?: string)to describe fields as ObjectID and UUID and add reference to another collection: import{extendZod}from"@zodyac/zod-mongoose";import{z}from"zod";extendZod(z);constzUser=z.object({// Just the IDsomeId:zId(),wearable:zUUID(),// With...