Skip to content

Feature Request: Add update method for GeospatialIndex #21

@zoom2009

Description

@zoom2009

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.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions