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

Nested optional search field type error

Given a schema that looks like this: ```ts documents: defineTable({ fieldOne: v.string(),...

Return value validation question?

If i wanna use the return value validation in a function. And say that function returns an array of documents. How may i define the return value, as the doc. I have a myValidator exported from a validators.ts file that i can use like returns: v.array(videoValidator) But that ends up erroring, since what im returning is the result of a .collect() so basically what ends up coming through is system fields aswell....

.order vs manual sorting using _creationTime

so I am getting the expected results using manual sorting using _creationTime and not using .order("desc")? any clue why?

Slow deployments during dev

I noticed that deployments from the dev environment have started to take around 15 seconds. I’m not too sure if it has always been the case. I don’t much much more info - but just wondering if this is something others are already experiencing and if this is a known issue (or if not an issue, whether to just accept it). Thanks a bunch!...

Does convex support database triggers?

I’m looking for guidance on implementing database triggers. I attempted to manage created, updated, and deleted documents by tracking in each mutation and scheduling actions to handle these changes. However, I soon realized that this approach becomes challenging to manage at scale, especially with more mutations across multiple tables. Is there a centralized method to handle database triggers more efficiently?

Blew over file bandwidth free limit and am confused as how to handle it

Hi, please ping me for my account email (not going to disclose it publicly, I fear spam), but I recently uploaded some 2-10mb videos to my free account for an app I'm building, and - in one day of only me and my fiancée testing it - we blew over 1gb of file bandwidth, going up to 3.6gb. This feels like an absurd thing, to be taxed by bandwidth. All of my users are supposed to have those videos, so I can see my costs skyrocketing for something silly like this, which is crazy and feels scummy on an otherwise amazing product. I'll of course remove those files and use uploadthing or some other thing that doesn't charge me per bandwidth. Please, contact me and help me understand how I could've better handled this situation. The way I see it, the only way to avoid it is to NOT use convex for file storage, which feels bad....

import.meta in Convex

I get this error in Vercel, but not locally. This error happens because of the presence of import.meta
No description

Running multiple projects in convex backend

Hello, I ran the convex-backend repo on my local. Only 1 project is running in it. How can I increase this?

Q: Marking a Path as External

I've just encountered this error message: ``` ✘ [ERROR] Could not resolve "$env/static/public" src/lib/api/weather.ts:1:39:...

convexAuth id of the current user on the client?

Hi, i know how to do it on the backend functions (const userId = await auth.getUserId(ctx); ) But how to get currently loged user in the client side? I want to display email an image in the avatar.. Regards (sorry if it too obvious, but i jhave read the docs several times and i didn't found it)...

Weekly and Monthly Cron Jobs

I just want to clarify the schedule parameters for the weekly cron job. I want the cron job to run on the Monday of every week by 12am. How do i go about that? The weekly cron job code snippet in the doc didnt include the day key and value but the monthly includes it. `crons.monthly(...

Stopping infinite pagination

What is the best way to keep a paginated query from expanding in length forever as new results come in? I have a couple ideas but i couldn't find this talked about anywhere.

What token to pass when doing fetchQuery on the client

Maybe this is a really stupid question, but when I do await fetchQuery on a client function (e.g. .ts file marked as "use client"), I can't get a token from getAuthToken (for server auth) and getUserIdentity returns null... Any ideas?...

vector search stopped working

My code has not changed for a few weeks, and now the vector search method inside actions is no longer returning results when using the filter property.

Custom functions <> return validators

If I have something like this: ```typescript export const authenticatedQuery = customQuery( queryRaw, // The base function we're extending {...

Rate Limiting Options

would love to be able to set custom rate limits for the actions, queries, mutations, and actions. it would be nice to manually add IP addresses to block, block by country, query depth limits, etc....

Convex queries running on Clerk sign up page causing uncaught errors

I have this ConvexClientProvider: ```typescript const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!); export default function ConvexClientProvider({...

Convex Auth: Implementation with Svelte(Kit)

I've just started learning SvelteKit and Convex, and recently (yesterday) began implementing an auth solution with Clerk. Today, I've woken up to see that Convex Auth is in beta and I feel like the perfect case study – but all the docs are written for React! I'm wondering if Convex Auth is available to use in SvelteKit and, if so, if someone would kindly walk me through the process! Cheers!...

Record counts for large numbers of records is non-trivial

I've handled counting needs for large numbers of records (any amount greater than I can reasonably list purely for a count, so over 500 maybe) by keeping count fields and incrementing/decrementing at write time. I'm now noticing failures due to that number changing too much during batch mutations, so I'm having to rework to add special handling for those cases. Which is making me realize there are other such cases in my codebase that are probably just a chance away from a random failure. I'm thinking through other novel approaches, such as updating count daily or on certain events, by paginating through the records and updating a given count field as a whole. But that's a lot of data moving out of the database just to get a count....

Difference between union of true & false vs boolean validators?

I recently wrote a ValueToValidator type which converts a Convex Value into its corresponding Convex Validator. It was quite tricky to write, but it's now almost entirely functional, save one small inconsistency. ```ts type Boolean = ValueToValidator<boolean> // ✅ VBoolean<boolean, "required">...