2015-08-18

MongoDB - Array add to set (insert a value), unless it already exists, to an array type of field

db.COLLECTION_NAME.update(
    {FILTER_HERE}
    , {
        $addToSet : {
            FIELD_NAME_WITH_ARRAY : VALUE_HERE
        }
    }
);