Getting 1 item by _ID from the DB.
This code seems to work compile and not throw any errors.
But I can't use getOne.
This code:
tells me "Type 'string' is not assignable to type 'Id<"chats">'. Type 'string' is not assignable to type '{ __tableName: "chats"; }'"
I just want to get a specific chat via that _id that is in the database... What am I doing wrong becvause all of the examples say this should work.
getting all the chats works fine.
please help!
3 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
You need to assert the type when you're using a string, eg.,
as Id<'chat'>
thanks