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

self-hosted

announcements

filter index based on multiple possible values?

consider the following query, where we want to select all posts made by a user, with a particular status of pending. due to lots of users, and lots of posts per user, we have an index set up to index posts by ["userId", "status"]. therefore, we query like so: ``` const userPosts = await ctx.db .query("posts") .withIndex("by_userId_status", (q) => q.eq("userId", user?._id).eq('status', 'pending')...

Problem posting an image to Convex storage. Please help me!!!!

Hiii, I'm building an expo app and I'm stuck in the user profile data form because there is a problem posting an image to Convex storage. When trying to post the image to the previously generated url the return status code is 400 and no logs generaterd (convex dashboard). I've trying every single possibility (from AI and from the web) and nothing solves the problem😩 . Aprecciate anyone can help me!šŸ™...

Convex Auth catching different type of error on sign in/sign up

I want to be able to display the right message to user for example. on sign up - user already sign in - password is not secure enough...

[ConvexAuth] Doc<'users'> don't update from default authTables

I have extended the users table in my schema to include more attribute required for my project. However, when I want to get the type from Doc, it believes my users table is the one from authTables, and not my updated version.

I'm having problems integrating launch darkly

``` // convex/convex.config.ts import { defineApp } from "convex/server"; import launchdarkly from "@convex-dev/launchdarkly/convex.config"; ...

convex swift with clerk

I checked the convex demo with swift https://github.com/get-convex/ios-convex-workout/blob/main/WorkoutTracker/WorkoutTrackerApp.swift I saw the authProvider is for Auth0, so does it support Clerk?...

I need to rekey my tables after importing

I'm used to a database-first development approach (only an SQL background) meaning that any modifications to the structure of my data/tables/relations, I have always managed directly in the database via SQL statements. I'm fully on-bard with Convex's mission and position on SQL, but I'm still in the early stages of the Mt Everest of learning curves for me. I've started small, imorting a primary table, some secondary tables (my terms) and a few many-to-many tables that link them. Since convex generates new unique row IDs, I would like to update/replace the values that make up all of the relationships in the many-to-many linking tables. What is the convex/JS way to do this, updating foreign keys based on new primary keys?...

Types for resuing filters

Anyone know how to type a filter we may want to reuse? Goal: ```typescript...

Not getting indexRange callback type

Hey all, I'm having an issue with one of my queries where the type of q inside withIndex is not being inferred. Did I miss something? ```ts export const getSpins = query({ args: {...

How would you handle third party subscriptions in convex

Hi, I am using convex and trigger to do background task processing and I am looking at trigger's realtime SDK. In some bit of code, they 'subscribe' to changes to the task run like in this example they gave. Was wondering is this safe to do in a convex action? Or would it cause the action to hang indefinitely or eat up a lot of bandwidth? Any advice is very much appreciated thank you! link to the docs: https://trigger.dev/docs/realtime/overview ```ts...

github oauth stuck in redirect loop

Hello kind folks, I am using github oauth and resend, like in the demo boilerplate project when initializing a convex app with NextJS, convex auth, github oauth, and hosting on Vercel. In development, login works. In production, login actually works, the database receives the correct user data from github, but the front end crashes. ...

Searching arrays in Data dashboard

If I have a record type with an array of id's ```{ _creationTime: 1737401929651.7922, _id: "ns7e3hnk37vk38bwg84bpfgt5x78rpkn", ...

Type error when NOT directly calling function (new to Convex 1.18.2)

I see in the update notes, it's not a good practice to call a function directly from another function. However, when rectifying this (e.g. using ctx.runQuery(myApiQuery) vs myApiQuery() I'm getting the stubborn "Function implicitly has return type 'any' because..." error. Any idea why this is now upsetting the type system? ...

Can't build source using a mac

mac 15.2 node 18.10 npm: 8.19.2 latest rust latest pnpm...

Query arguments issue?

Came across an interesting problem that I was hoping to get some help with. Basically I have a query that receives a timestamp as an argument to control what information is returned. This argument will change in certain key situations. I know the default Convex behavior is to create a new subscription for each set of arguments, but I don't want all these subscriptions active because those will consume too much data. Is there a way to close unwanted subscriptions?...

Debug Internal Node Errors

I tried to setup Assembly AI with their SDK, but I got this error. Running this code from a conex action causes this error, I do not know how to debug this or what the actual error message might be. I have 'use node' directive at the top of the action file Are there plans to make debugging internal node errors like this easieer? Can I get help with what went wrong...
No description

How do I search for a value in a table that is related to another table in relationship?

So I have a table called messages and another table called messages members, I'm trying to search for messages that are equal to the search query but at the same time the user is part of? I've tried creating a paginated query: ```ts const channelsWithUser = await ctx.db.query("members")...

[Convex Auth] Clerk Integration with Convex

Clerk will automatically create a convex user for social sign ups but the same flow doesn't work for email sign ups. Convex user is not being created automatically for Email sign up flow while it works correctly for social signup and sign in. The following is the code for email password registration. ``` const [email, setEmail] = useState("");...

[Convex Auth] How to access param in `createOrUpdateUser` callback

Hello, I’m working on a system similar to AWS IAM, where a root user can create sub-users. The sub-users can log in using a combination of the root user’s ID, their own email, and password. Currently, I have two tables: one for root users and another for sub-users. While I can customize user creation and updates by implementing my own createOrUpdateUser callback, I’m facing a challenge. There’s no way to access supplementary data, such as the root user ID, during the login process. This makes it difficult to allow sub-users to authenticate using the required root user ID + sub-user email + password combination. Any workaround?...

Convex on my lambda

I need to ingest some data to convex. how do I authenticate convex on a lambda instance? Also would I use mutation with the client from convex/browser? ```js import { ConvexClient } from 'convex/browser' const client = new ConvexClient(CONVEX_URL)...