Skip to content

Commit

Permalink
Needed count($mayRequireInsert)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilportugues committed Mar 2, 2016
1 parent 4161f15 commit 741bbb9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function addAll(array $values)
$insertedIds = $result->getInsertedIds();
$updatedIds = $result->getUpsertedIds();

if (0 === count($updatedIds)) {
if (0 === count($updatedIds) && 0 !== count($mayRequireInsert)) {
$result = $this->getCollection()->bulkWrite($mayRequireInsert, $options);
$updatedIds = $result->getInsertedIds();
}
Expand Down Expand Up @@ -445,6 +445,11 @@ protected function bsonDocumentArrayToNativeArray($bsonDocumentArray)
return $resultArray;
}

/**
* @param array $store
*
* @return \MongoDB\InsertManyResult
*/
protected function addMany(array &$store)
{
/* @var \MongoDB\InsertManyResult $result */
Expand Down

0 comments on commit 741bbb9

Please sign in to comment.