payload
payload copied to clipboard
Breaking: MongoDb - Versions cast the "parent" key incorrectly
Link to reproduction
No response
Describe the Bug
On a collection with number ids, when creating new versions of a document, the parent key will be either Number or String, it is not consistent. It causes several versions of the same document to appear in the collection view, but more importantly it causes Drafts and Published versions to malfunction.
This is not the same as #5355.
I have a working patch in production, will submit a PR.
To Reproduce
- Create a collection with Number IDs and versions active.
- Create a document
- Create a new version for that document
- Inspect the database. There is a high chance the version's parent key is String. I've had both Number and String in my tests.
Payload Version
2.16.1
Adapters and Plugins
db-mongodb