#questio
3 messages · Page 1 of 1 (latest)
Hi @boreal thorn. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
No — v.id("files") only validates the type and table, not that a document with that ID actually exists.
What v.id("files") does:
- Ensures the argument is a Convex
Id<"files">(i.e. a string shaped like a Convex document ID and associated with thefilestable). [Supported types; Document IDs] - This protects you from someone passing an ID from another table or a non-ID value.
What it does not do:
- It does not check that there is a row in the
filestable with that ID. You still need to callctx.db.get("files", args.fileId)and handle thenullcase yourself. [Document IDs]