Skip to content

Commit c9813c6

Browse files
committed
fix: find() now uses getKeyName() for primary key
1 parent 74d6f21 commit c9813c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Jenssegers/Mongodb/Query/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public function hint($index)
198198
*/
199199
public function find($id, $columns = [])
200200
{
201-
return $this->where('_id', '=', $this->convertKey($id))->first($columns);
201+
return $this->where($this->getKeyName(), '=', $this->convertKey($id))->first($columns);
202202
}
203203

204204
/**

0 commit comments

Comments
 (0)