Convex Community

CC

Convex Community

Join the Convex Discord! Explore Convex, the fullstack TypeScript platform for developers and startup founders.

Join

support-community

show-and-tell

general

open-source

announcements

Which identifier generator library to use for message channel and threads?

1) I am building a Discord-like messaging experience. For servers, channel, threads, etc. it appears that Discord uses Snowflake IDs, 18-integer long numeric values. What would you recommend for a Convex project? It seems that for a single Convex project, IDs that are unique over distributed database nodes is not important, but sort-ability and query performance are important.
If I wanted to keep my programming efforts really simple, I could simply use a _id field values themselves, but 32-characters is a lot of characters to put in URLs, especially when multiple resources are involved. ...

Delete a document by multiple fields??

Hey I've this schema for one of my table! `name: v.string(), email: v.string(), imgUrl: v.string(),...

Advanced index usage

I don't understand why I can't do any of this with a index. I didn't see in the docs a explicit explanation that you couldn't do something like this using the available .eq,gt,gte,lt,lte so i tried a few things. ```ts assume ['by_index1_index2_index3'] (q) => q .gt('index1', null...

v.string().isOptional property not working

Hello, I saw available the isOptional property in the v.string() But I have an error after I use it in the property name. ```...

Convex + Clerk crashing in react-native after using the new Convex Auth

Hi Convex team, I have 2 applications: 1 react-native-expo app using convex.dev (+ clerk for authentication). This app has been happily working fine for the past 4 months. ...

Mono repo with Convex auth

I am using convex auth for my expo app Currently I am still using Clerk in my Next.js app for the web app I don't think I need any functionality the Next.js provides and am thinking of using Vite instead ...

convex auth user info

if I am using convex auth, how do I get the user id from the backend is there something like ctx.auth I was using ctx.auth.getUserIdentity and using tokenIdentifier, but it makes more sense to use user id but I am unsure the correct pattern to get that info...

Query documents by array of documentIds possible?

Is there any way to get the documents by array of documentIds? here I'm querying my documentIds in array! `const collaborators = await ctx.db...

How do you get the issuer for a new user account from Clerk webhooks?

I followed this documentation: https://docs.convex.dev/auth/database-auth#set-up-webhooks and was able to use a Clerk webhook in order to automatically insert a document in users Convex table. But, I'm trying to adhere to the pattern where the users table has a tokenIdentifier column. ...

Database filter operator, contains

Does Convex dashboard have a database column filter operator, contains?

How can we do advanced querying on nested arrays ??

I've created this schema for one of my documents export const DocumentColumns = { title: v.string(), userId: v.string(),...

How to remove (delete) a column in a table

Hi, I defined a column in my schema within a nextjs app and saw it in the data tab on the convex dashboard. I don't want that column anymore and want to remove it from the schema and the table, but now I got an error in the console. ```...

Confusing errors on db.patch calls inside mutation

Hi, I'm making some changes to handle a new webhook event and started seeing errors when my mutation is called. The errors complain about missing required fields when calling db.patch:
Uncaught Error: Failed to insert or update a document in table "externalPayment" because it does not match the schema: Object is missing the required field `status`. Consider wrapping the field validator in `v.optional(...)` if this is expected.
Uncaught Error: Failed to insert or update a document in table "externalPayment" because it does not match the schema: Object is missing the required field `status`. Consider wrapping the field validator in `v.optional(...)` if this is expected.
...
No description

Understanding Convex Database Design Patterns

Hello, I'm new to Convex, and have some questions about design patterns. I've a listings table (title, category, etc...)...

fetch request on internal action

I am trying to send an email using nodemailer and gmail. I created an api in next js api app router. export const newUserEmail = internalAction({ args: { email: v.string(), name: v.string() }, handler: async (ctx, args) => { const newUser = await fetch('http://localhost:3000/api/email/newUser', {...

Convex Auth: Error types for signUp/signIn

Hi, is there a way to know the possible types of errors that the signUp / signIn functions can throw? I want to disambiguate between error causes on the frontend. Specifically, I want to do something like: ```...

NODE_ENV always equates to 'development'

There must be something I don't know since NODE_ENV always equates to 'development' regardless of its value. In "use node" functions it works as expected. This happens both in convex development and production environments.
No description

Convex Auth on Server Component

after sign up. this code below in server component, ```ts const currentUser = await fetchQuery(api.getUser.currentUser); console.log({ currentUser });...

Patch mutation function is giving me a typescript error

I'm trying to insert a document to a table in various steps. When I insert the first two pieces of data, the record is created and I push the id as searchParams so I can have access in the next form component. And as user keep filling forms, the document needs to receive the remaining data. This is the schema ```ts...
No description