Uploaded image for project: 'PHP ORMs'
  1. PHP ORMs
  2. PHPORM-240

laravel-mongodb - Issue #3151: _id returned by raw()

    • Type: Icon: Question Question
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Laravel
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Torquin has created Issue #3151: _id returned by raw() in laravel-mongodb. This Jira ticket was filed by GromNaN

      Issue Text:

      • Laravel-mongodb Version: 5.0.0
      • PHP Version: 8.2.22
      • Database Driver & Version: PECL mongodb driver 1.19.3

      Description:

      Following the latest update and id management, raw requests do not seem to return 'id' but still return '_id'

      Steps to reproduce

      1. $tmp = \App\Models\Container::first()->toArray(); => this returns id
      2. $tmp = \App\Models\Container::raw(function($collection)

      { return $collection->findOne(); }

      ); => this returns _id

      Expected behaviour

      Should receive 'id'

      Actual behaviour

      Receive '_id'

            Assignee:
            Unassigned Unassigned
            Reporter:
            dbeng-pm-bot PM Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: