$addToSet operator adds a value to an array only if the value is not already in the array. If the value is in the array, $addToSet does not modify the array.
$addToSet
Yep. But you need the $each modifier to be added in your statement:
$each
db.c.update({},{ $addToSet: { a: {$each: [ 2, 4 ] } } })
And the result:
{ "a" : [ 1, 2, 3, 4 ] }