Point type field has issues when using BeforeChangeHook #6810
Labels
db-mongodb
@payloadcms/db-mongodb
status: needs-repro
If an issue does not include a reproduction
v3
Link to reproduction
No response
Payload Version
3.0.0-beta.45
Node Version
21.6.2
Next.js Version
15.0.0-rc.0
Describe the Bug
I have a location collection. It has only couple of fields. One of the fields is coordinates type point.
If I set this field as localized,
In BeforeChangeHook I am unable to set the [long, lat]
The error comes from MongoDB: ERROR: MongoServerError: Can't extract geo keys ...
If I remove the localized attribute, it works fine.
Reproduction Steps
create a collection.
have one field as type point.
try to update this field on save using BeforeChangeHook
If it is localized, MongoDB will give error.
Adapters and Plugins
I am using MongoDB
The text was updated successfully, but these errors were encountered: