#missing delete mutation example in the docs

1 messages · Page 1 of 1 (latest)

vivid viper
#

Hey guys, I've been checking out convex. I managed to do auth, get and post operations.

But I can't seem to find docs on how to delete an item from a table. I've attached the type error I'm getting. I'm also attaching the post mutation which works fine.

If there're docs for this, please point me to them, thanks!

nocturne nacelle
#

hey @vivid viper ! thanks for trying convex

#

ids are database-unique. every id is the only id with that value in the whole database, not just for the table

#

in fact, ids embed information in them that lets convex know which table the id came from

#

if you remove the 'decisions' argument from that method, everything should work

vivid viper
#

hi Jamie, thanks for the fast response, that's what I initially tried, but I get this type error:

#

am I missing something?

nocturne nacelle
#

in your case I suppose it's a v.id('decisions')

#

this just gives you even more type safety that you're actually passing an id from the proper table into your convex functions

vivid viper
#

yooo, it works! Thanks for help Jamie. Keep up the great work!

nocturne nacelle
#

glad to hear it!

indigo thicket
vivid viper
#

hi @indigo thicket thanks for the docs link!

one thing that took me a bit of time to get used to is that in convex folder I have to reference type with "v", and in the app code I have to import them _generated/dataModel.

I think I saw it somewhere else in the docs, but not in the delete. Anyways, still a really cool product I love the analytics dashboard. This makes feel cloud function development achievable for mortals, I've been having a lot of fun 😄

main niche