#391

Multi-field range intersection

Requested

Submitted August 24, 2026

Please make normal Convex indexes more expressive by supporting multi-field range intersection.

Today, compound indexes can chain equality constraints and then apply a range to the next field. It would be useful to apply independent range constraints across multiple indexed fields and intersect them efficiently.

For example:

.index("bystatebbox", [ "state", "minX", "maxX", "minY", "maxY", ]) .withIndex("bystatebbox", q => q .eq("state", state) .lte("minX", longitude) .gte("maxX", longitude) .lte("minY", latitude) .gte("maxY", latitude) )

This enables bounding-box containment without requiring a dedicated geospatial index:

state == S AND minX <= x AND maxX >= x AND minY <= y AND maxY >= y

The primitive would also be broadly useful outside geospatial workloads:

startTime <= t AND endTime >= t minPrice <= price AND maxPrice >= price minAge <= age AND maxAge >= age validFrom <= date AND validUntil >= date

Ideally, Convex would intersect these ranges at the index level before materializing documents, rather than requiring separate index queries and application-side intersection.

Development Updates

No updates yet