Skip to content

Mutations ctx: ".patch" and ".replace" and "stripUnknownFields" #86

@danielyogel

Description

@danielyogel

Hey,

Right now when updating a table, it looks like any extra fields causes the transaction to fail, AND to provide unrelated error message, which is very time consuming to debug.

I suggest either implement "stripUnknownFields", so the common way of updating using something like db.update({...rowFromDB, someField: "true"}) would EITHER strip extra fields (it throws because of the default fields _creationTime, and _id - which is very confusing), OR throw a compile time error (limited because of TS nature of objects) or BOTH of them. Plus the runtime error message should be clear that this is the problem, right now it just prints the "value" and "validator", and when you use them locally - it shows a wrong error (convex-js/issues/85).

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions