too_easy
too_easy5w ago

Pre generating IDs

Seems that the mutateAsync function pre-emptively returns an ID for an entity. Just wondering if there is a way to do the same outside of using mutateAsync, like more programatically using the ConvexReactClient directly for example?
2 Replies
Convex Bot
Convex Bot5w ago
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!
Nicolas
Nicolas4w ago
Unfortunately this is not something that we support at the moment. If you need to pre-allocate Convex documents IDs on the client (e.g. when implementing optimistic updates), one alternative that you could try is adding a new attribute to your documents that you would use whenever you would use regular IDs.

Did you find this page helpful?