payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
23.07k stars 1.43k forks source link

Point type field has issues when using BeforeChangeHook #6810

Open jomapps opened 2 months ago

jomapps commented 2 months ago

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

JarrodMFlesch commented 1 month ago

@jomapps can you please provide a reproduction of this issue? If not we will likely close it.