I’m converting a Laravel 11 app that uses mongodb/laravel-mongodb
v4.8 to Laravel 12 with v5 of the mongo library. In the breaking changes for v5 part of the docs, it says this
``
id is an alias for the _id field in MongoDB documents, and the library automatically converts between id and _id when querying data. The query result object includes an id field to represent the document's _id field. Because of this behavior, you cannot have two separate id and _id fields in your documents.
So we have tons of records in Mongo going back more than a decade, all with `_id` as the key for each record (my guess is to be consistent with Laravel's `id` default). As I read this, all queries will now return `id` in a query result.
Am I reading that correctly? If so, in my code, where we refer to `_id``` in a document result, I have to convert it to look for `id`?