400 Bad Request: IndexFieldsNotUnique
400 Bad Request: IndexFieldsNotUnique: Hit an error while evaluating your schema:
Index fields must be unique within an index.
400 Bad Request: IndexFieldsNotUnique: Hit an error while evaluating your schema:
Index fields must be unique within an index.
Can Convex be a backend itself?
Starting a thread here for "is Convex a backend;" the summary is
- Convex functions don't run in browsers, they run on the Convex backend.
- Both web browsers and other servers (like a Next.js server) can talk to Convex, generally the WebSocket-based ConvexReactClient makes sense in browsers and the ConvexHttpClient makes sense in backend servers like Next.js server components and API routes.
- The code for a Convex backend can be placed in another package in a monorepo; I'll find a previous thread wiht this approach and link to it. The gist is that you need to export the API object so that it can be used in another package.
- The code for a Convex backend can also be placed in an entirely separate repo but if you do this it's more difficult to use the API object....
I'm in a similar situation as @niels
I'm in a similar situation as @niels
How would be the syntax to use convex together with a State Management library?
I mean, how can I query the convex database without using hooks (ie. useQuery)?
Couldn't find anything related to that in the doc...
Querying multiple IDs
Quick question - is there planned support for
IN
query filter, e.g. passing a list of IDs to the query filterDate parsing behavior
That seems like something for us to fix, thanks for pointing it out @CodingWithJamal. Be aware that built-in date parsing with either
new Date(s)
or Date.parse(s)
is inconsistent between runtimes (ie it works differently in Safari) so it's often not recommended.I am seeing a lot of these this
I am seeing a lot of these this afternoon. Are there any slowdowns at Convex right now or maybe our app is growing out of bounds?

bidirectional relationships
Trying to determine the best schema for "friends" (many to many) feature.
As someone who's not experienced on the SQL side of things, would love to know if im missing anything and/or there's a better approach altogether.
The main features/capabilities for the friends feature will be to fetch a list of friends, as well as to update any meta data between these friends.
Fetching a users friends is much more frequent.
...
thread
Theory-craft this with me.
If you were going to re-create this game: https://cardsjd.com/minesweeper/game/#/menu (which is a multiplayer minecraft game) using Convex.dev how would you go about it?
Some issues I have been 🤔 ...

Uniqueness enforcement
Is there any way to enforce "unique" documents at the field/property level?
As in, can we make it so that we're able to set a property to hold a unique requirement, where only unique documents can be added based on that property?...
Type error when index is on an optional field
I hit something similar today: I get a type error if the index is on a field that's optional.
It still works, but the typescript compiler complains in the
q.eq("myOptionalField", value)
...I think there is a potiential bug in the
I think there is a potential bug in the logs, or some weird behaviour. For the first many entries, it shows a lot of configuration stuff and if i scroll up it shows my query logs that im initially wanting to monitor. This makes it very difficult to read my query logs.
Does anyone here have success/working
Does anyone here have success/working example how to mock convex hooks? I tried to follow the injection test example with
fakeConvexClient
from convex-helpers repo. But no matter how i try to set it up I get the error TypeError: Cannot convert object to primitive value at Object.localQueryResult
. This also happens if you run tests in the convex-helpers repo, so probably fakeConvexClient
class is outdated...NextAuth / Auth.js Support
Could convex have an
Auth.js
Adapter? https://authjs.dev/guides/adapters/creating-a-database-adapter I think convex should have one like clerk as its usedb y many who want more control over there auth. Ive been currently been trying to make a custom one in my app for my project and its a lot of config.Which process.env does Convex expose? I
Which process.env does Convex expose? I would like to check if the functions are running in dev, preview or production.
Querying for records with an array field that contains a value
Im writing a query to return a users available projects they are a member of. How can i query the DB and check that the user_id is in the array i am comparing?
I have provided the query so far and the project schema....

What is a module?
Lots to unpack. Fantastic. Looking forward. Thanks for the detailed update! Especially looking forward to the Module System. Is that something akin to a library of Functions (open to all of the Convex community to build) that can be imported into projects? Curious what you meant by not having to copy and paste in that scenario.
I am setting up Preview Deployments. I
I am setting up Preview Deployments. I just saw this, I think it's just a temporary error, but the CI build (Vercel) didn't abort. Could it be that no error exit signal was sent or such?

conditional filter
Is there a way to conditionally filter a query? It doesn't seem possible to break up the chaining conditionally, and it also doesn't seem possible to exit early from the
.filter(...)
function. Id rather not write out the entire query chain multiple times for each condition, as this is the only part of the query that changes.