Remove _id from result for query builder

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • 5.0.0
    • Affects Version/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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

              Assignee:
              Jérôme Tamarelle
              Reporter:
              Jérôme Tamarelle
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: