payload icon indicating copy to clipboard operation
payload copied to clipboard

Breaking: MongoDb - Versions cast the "parent" key incorrectly

Open apetrisor opened this issue 1 year ago • 0 comments

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

  1. Create a collection with Number IDs and versions active.
  2. Create a document
  3. Create a new version for that document
  4. 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

apetrisor avatar May 14 '24 09:05 apetrisor