Skip to content

Commit

Permalink
update addToSet function in order to support mixed dataset. also supp…
Browse files Browse the repository at this point in the history
…ort $each operation
  • Loading branch information
Madthumb committed Feb 19, 2016
1 parent f8a0e39 commit a752eff
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 a752eff

Please sign in to comment.