𝗠𝗜𝗖𝗞𝗘𝗬
CCConvex Community
•Created by 𝗠𝗜𝗖𝗞𝗘𝗬 on 11/23/2024 in #support-community
[Ents]: Ordering on Edge
Hello all,
I have a question which in short is whether (or rather how) it's possible to order the query of many:many edges on the other end of the edge using convex-ents.
I have user ents which can "attend" events ents - i.e. many:many relationship. I want to query the events a single user is attending and in the same query order the retrieved events based on the start date of the events (in the db as a
string
, like 2025-01-24T12:30:00.000+01:00) as follows:
The events schema contains an index for "startdate". But my retrieved results are never ordered by the startdate.
My current solution looks like this:
Perhaps there is a more efficient way to do this since I'm filtering out the results that have a startdate in the past anyway.
Any help would be highly appreciated 🙂5 replies
CCConvex Community
•Created by 𝗠𝗜𝗖𝗞𝗘𝗬 on 4/7/2024 in #support-community
Convex Ents 1:many rel
Hey!
I'm playing around a bit with Convex Ents and I'm running into an issue which I don't know if it's due to my lack of understanding how edges works.
I've got two tables with a 1:many relationships,
organisers
can have many events
or none, and events
can have one organiser
or none. So my idea was this:
Getting no TS warnings in my IDE, but when saved I get this response from the CLI:
Am I doing something wrong or is it simply impossible for the singular edge to be optional? I noticed the docs say that optional 1:1 are not supported but I figured this is a 1:many so it might not apply.6 replies