Skip to content

Commit 1bd7511

Browse files
authored
Merge pull request #9 from christophej/fix_builder_insert
Update Query\Builder::insert() to handle empty values
2 parents fea23e7 + 668109a commit 1bd7511

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Query/Builder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,10 @@ public function forPage($page, $perPage = 15)
550550
*/
551551
public function insert(array $values)
552552
{
553+
if (empty($values)) {
554+
return true;
555+
}
556+
553557
// Since every insert gets treated like a batch insert, we will have to detect
554558
// if the user is inserting a single document or an array of documents.
555559
$batch = true;

0 commit comments

Comments
 (0)