Type Alias CollectionMutationSchema<TShapeSchema, TQuerySchema>

CollectionMutationSchema<TShapeSchema, TQuerySchema>: z.ZodObject<{
    patch: z.ZodOptional<z.ZodObject<{
        with: ReturnType<TShapeSchema["partial"]>;
        query: TQuerySchema;
    }, "strip">>;
    delete: z.ZodOptional<TQuerySchema>;
}, "strip">

This schema represents an ability to update/delete collection of the given data using a query.

Type Parameters

  • TShapeSchema extends ShapeSchema

    Shape of a mutation (for patching).

  • TQuerySchema extends QuerySchema<FilterSchema, OrderBySchema>

    Query schema used to filter out collection to mutate.

Type declaration

  • patch: z.ZodOptional<z.ZodObject<{
        with: ReturnType<TShapeSchema["partial"]>;
        query: TQuerySchema;
    }, "strip">>

    When specified, patch is executed; takes precedence over delete.

  • delete: z.ZodOptional<TQuerySchema>

    When present, delete is executed on collection specified by it's query.