Skip to content

_id returned by raw() #3151

Closed
Closed
@Torquin

Description

@Torquin
  • 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'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions