Skip to content

Commit

Permalink
Merge pull request thephpleague#37 from maxtrunk/master
Browse files Browse the repository at this point in the history
update addToSet function in order to support mixed dataset.
  • Loading branch information
bcrowe committed Feb 19, 2016
2 parents f8a0e39 + a752eff commit d4691de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/League/Monga/Query/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,17 @@ public function pullAll($field, $value, $operator = null)
}

/**
* Adds the values of an array to the set only
* when the array doesn't contain them already
* Adds the values to the set or upsert
* when the dataset doesn't contain them already
*
* @param string $field field name
* @param integer $value value to increment by
* @param mixed $value value to set/upsert with
*
* @return object $this
*/
public function addToSet($field, $value)
{
return $this->update('$addToSet', $field, (array) $value);
return $this->update('$addToSet', $field, $value);
}

/**
Expand Down

0 comments on commit d4691de

Please sign in to comment.