Skip to content

Commit 8bfdaab

Browse files
author
TCB13
committed
QueryBuilder::select fix always missing _id property.
1 parent dfaa867 commit 8bfdaab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/QueryBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function select($fields): self
206206
}
207207

208208
// Exclude built in _id if not set in fields - MongoDB always returns this by default
209-
if (!in_array("_id", $fields)) {
209+
if (!array_key_exists("_id", $this->fields)) {
210210
$this->fields["_id"] = 0;
211211
}
212212

0 commit comments

Comments
 (0)