vorsV
Convex Community3y ago
3 replies
vors

Document creation type

What's the correct way to re-use my schema elements in the functions? I'm trying to use them as is and for example insert them, but running into problems that there are also _id, _creationTime fields, that I'd like to auto-populate.

Concretely here is a mutation I'd like to call

export default mutation(async ({ db, auth },
    generation_id?: Id<"generations">,
    new_generation?: Document<"generations">) => {


And here is the callsite

const generation = {
    project: project_id,
    // more-fields
}
await runMutation("storeGeneration", undefined, generation);


I'm getting
_id, _creationTime are missing fields
Was this page helpful?