Skip to content

Commit bdddfb5

Browse files
GromNaNjmikola
andauthored
Update src/Eloquent/Builder.php
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
1 parent 1b2d1d8 commit bdddfb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Eloquent/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ public function createOrFirst(array $attributes = [], array $values = []): Model
214214
try {
215215
$document = $collection->findOneAndUpdate(
216216
$attributes,
217-
// Before MongoDB 5.0, the $setOnInsert does support empty document,
218-
// so the filter value are added to avoid an error.
217+
// Before MongoDB 5.0, $setOnInsert requires a non-empty document.
218+
// This is should not be an issue as $values includes the query filter.
219219
['$setOnInsert' => (object) $values],
220220
[
221221
'upsert' => true,

0 commit comments

Comments
 (0)