-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: Laravel
-
None
After PHPORM-147, we encourage the use of “id” instead of “_id” for cross-compatibility with Laravel SQL Query Builder. Currently, the query builder returns "_id" and "id" when "_id" is is the result data. This can be confusing when you don't know which field to use.
Removing "_id" avoids ambiguity and maintains compatibility with Laravel.
Also, when the result document is used as input for insert/update, this prevent having duplicate fields. https://github.com/mongodb/laravel-mongodb/pull/3040#issuecomment-2330222281
- related to
-
PHPORM-147 Alias id to _id in the query builder
- Closed