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

How to query items where array field contains a specific value?

I have a paginated query where I need to filter items based on whether an array field contains a specific category ID. Currently, my query only returns items where the array exactly matches [categoryId], but I need it to return items where categoryId is one of potentially many elements in the array. Here's my current query: ```typescript...

Calculating average rating across a large dataset

Hello! I'm currently looking to build a feature that shows the average rating of a show based on entry logged by users. This is my first time approaching something like this Convex. I was wondering if there were any recommended solutions? I was looking into the Aggregate convex component to potential solve my problem. The only issue I've have with that approach is that a user can log an entry without rating it, but the sameValue does not accept undefined. ```ts export const animeStatsByEntry = new TableAggregate<{ Namespace: Id<'anime'>...

Zod Unions appear to break `Table` helper (maybe zodToConvex related?)

https://stack.convex.dev/convex-the-database-that-made-me-switch-careers I'm following the pattern described in this article and getting an type error here. Looks to be since the Table expects a Record while the union produces an array of members. This still works below so i'll do this, but wanted to flag this in case it wasn't known...
No description

Upload large file

Hello 🙂 I am trying to upload a large video file via upload URLs. When it is via small images or vidos <50mo it works but if it's bigger it doesn't. If anyone can help ?

Turborepo

I'm fiddling around to get a turborepo working. Everything is fine but running "npx convex dev" inside project/packages/backend gives me: Could not resolve "fs" ../../node_modules/next/dist/compiled/gzip-size/index.js:1:2840: 1 │ ...)?processFn(o,r):o}return n}},147:e=>{"use strict";e.exports=require("fs")},781:e=>{"use strict";e.exports=require("stream")},796:e=>{"use str...}...

Is there a way to infer "union of column name literals" from a table schema?

Hi! When implementing a query that accepts sortBy as an arg, I'm specifying it to be a string. ```tsx args: { sortBy: v.optional(v.string()),...

Dashboard functions search bug

If you try to search for functions in dashboard/functions, and its not found, you can like go back to the functions list? Even if you actually click on Files and then Functions, it still show no functions in this deployment! Please fix....

adding react native (expo) to existing Next + Convex app (with Convex Auth)

I'm pretty new with Mobile and prefeably wouldnt want to use Turborepo to avoid major refactor (and i have skill issue). how would i achieve this? any advice ?

Use Multi Convex projects

Hey, I love convex but I was wondering if there was any best practice or advice around using mutli convex projects in a single application. For context, what I want to do is build out a private npm package that has common integration for Clerk so I don't have to keep rewriting code and setting up the integration for each app. In My use case its fine to have a central auth to connect everything. ...

Internal queries/mutations/actions vs helper functions

Hi everyone! I'm trying to understand the difference between internal queries/mutations/actions and regular helper functions. I'm going to write down my thoughts here, in a contrived example., and I hope you can help me understand it better. Thanks! ```ts // convex/somefile.ts import { internalQuery, query } from "./_generated/server";...

The ctx.storage.getUrl() method is marked as deprecated, but Convex docs provide no alternatives

The storage serve docs direct the use of ctx.storage.getUrl(), but my IDE says the function is deprecated. https://docs.convex.dev/file-storage/serve-files What, then, is the best practice for accessing stored file data?...

convex auth with hono

Hi, I'm using Hono with Http Actions. In this case, how could we connect http actions with convex auth? export default new HttpRouterWithHono(app);...

Refine.dev

can any body make a data provider for convex? it will be a great addition.

Handling Upserts with Optional System Fields

Not sure if this is the best practice here but didn't appear there's a way of getting the Id field to be optional so it can be passed in for upserts (if it doesn't exist, insert, if it does patch). Not sure if my types are entirely correct but seems to work but happy to hear if anyone else agrees ```ts function upsertDeal(ctx: MutationCtx, args: MakeIdOptional<Deals>) { if (args._id) { // type _id = string & {} | undefined...

using push notifications component in monorepo with react native expo

Hi all. I am attempting to use the new convex component expo push notifications. I have a monorepo (using turbo-repo + pnpm) with 2 apps: a react-native expo (SDK 52) app and my convex backend. This is (roughly) the monorepo project structure ``` apps/ convex/ expo/...
No description

Can Convex Handle Video Segmentation, Storage, and API Integration for Generating Long-Form Videos?

Hi, I’m building a video platform where users can generate short videos using a text-to-image generator. Currently, the platform can only produce 8-second videos, so for a 60-second video, I need to create multiple 8-second clips and combine them into a single video. I’d like to know if Convex can support this entire workflow, such as: ...

Underscores not allowed at start of nested fields

We've run into this issue when storing some data inside v.any() fields. This is a blocker for us cause we have to store changes of our customer's schema in Convex so it would be great to have this limit removed. If I'm missing something please let me know!...

Dynamic query builder in convex

I'm trying to do a dynamic query based on conditions ```ts import { v } from "convex/values"; import { BookingStatus } from "./lib/bookings";...

Cannot store/validate `undefined` in array?

Just making sure I'm not missing something

nextjs handling server-side errors in error page

I'm using Nextjs, and I've setup a catch all error page to handle all errors, I've set it up to show formatted convex Errors if it's instanceof ConvexError see code below: ```typescript "use client"; import ......