Description
Hi,
In a previous version of our Laravel project, we used the jenssegers/mongodb package, which allowed us to define and use both id and _id fields independently. This was extremely useful for us, as our project was originally built on MySQL and later migrated to MongoDB.
Throughout our codebase (both frontend and backend), we consistently use the id field as a numeric identifier. The old package allowed this without overwriting the MongoDB-native _id field (BSON ObjectId). However, with the current behavior, assigning a value to the id field seems to overwrite the _id, which breaks our expectations and potentially a large part of the application.
We’d really appreciate support for handling the id and _id fields separately again — just like jenssegers/mongodb used to.
Do you have any suggestions or potential workarounds? Refactoring the entire project would be extremely risky and time-consuming.
Thanks in advance!