Skip to content

Commit

Permalink
bugfix pluck
Browse files Browse the repository at this point in the history
Fix bug in pluck function.
Cannot use object of type stdClass as array
  • Loading branch information
fuyuki0511 authored Oct 4, 2024
1 parent 5c7e240 commit e51bc61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ public function pluck($column, $key = null)
// Convert ObjectID's to strings
if (((string) $key) === '_id') {
$results = $results->map(function ($item) {
$item['_id'] = (string) $item['_id'];
$item->_id = (string) $item->id;

return $item;
});
Expand Down

0 comments on commit e51bc61

Please sign in to comment.