Permalink
Browse files

update addToSet function in order to support mixed dataset. also supp…

…ort $each operation
  • Loading branch information...
1 parent f8a0e39 commit a752efffb5c7c2296de2df170adcfd2a51cf43b0 @Madthumb Madthumb committed Feb 19, 2016
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/League/Monga/Query/Update.php
@@ -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);
}
/**

0 comments on commit a752eff

Please sign in to comment.