get-convex / get-convex/geospatial
Feature Request: Add `update` method for GeospatialIndex
- Dominant language
- TypeScript
- Stars
- 29
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
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:
```ts
geospatial.insert()
geospatial.remove()
````
Here’s an example of what I’m doing:
```ts
const geospatial = new GeospatialIndex>(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:
```ts
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.
---
Contributor guide
Assessment
This issue has not been assessed yet.