VincentRPS
VincentRPS3mo ago

How to use custom IDs

Hello, I'm wondering if there's a way to use custom IDs in _id? I want to use ULID, Snowflakes, or some other generation method which can be K-sortable since I'm trying to make a messaging app with querying of before and after a possibly deleted message, only possible by using lesser than and greater than on the IDs which would need to be sortable (unless they already are and I'm misunderstanding?).
3 Replies
Convex Bot
Convex Bot3mo 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!
erquhart
erquhart2mo ago
Not currently - maybe a deleted message has it's content wiped but the message record remains so you have access to _creationTime and can use that for before/after?
Nicolas
Nicolas2mo ago
Have you tried creating a custom ID field and putting an index on it?

Did you find this page helpful?