-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Feature Request: Add update method for GeospatialIndex
Hi Convex team 👋
I'm building a dating application using @convex/geospatial, and currently, it seems that the API only supports:
geospatial.insert()
geospatial.remove()Here’s an example of what I’m doing:
const geospatial = new GeospatialIndex<Id<"profiles">>(components.geospatial)
await geospatial.insert(ctx, profile._id, {
latitude: profile.location.latitude,
longitude: profile.location.longitude,
}, {
lookingFor, // "male" | "female" | "both"
})However, my users can later update their lookingFor field (e.g., from "male" to "both").
Right now, I have to remove and reinsert the record to achieve this, which feels inefficient.
🧩 Feature Request
It would be great if the library supported an update method, such as:
await geospatial.update(ctx, profile._id, {
latitude,
longitude,
}, {
lookingFor,
})This would make it easier to update metadata or location without needing to remove and reinsert the record.
nyoung697
Metadata
Metadata
Assignees
Labels
No labels