------------------------------------------------------------------------------
$ cat test_case.rb
require 'mongo'
db = Mongo::Connection.new.db('sample-db')
coll = db.collection('test')
coll.remove
coll.insert({:_id => "test_add_to_set", :arr => []})
coll.update({:_id => "test_add_to_set"}, {:$addToSet => {:arr => {:$each => [1,1,2,3]}}})
puts coll.find({:_id => "test_add_to_set"}).next_document.inspect
$ ruby test_case.rb
{"_id"=>"test_add_to_set", "arr"=>[1, 1, 2, 3]}------------------------------------------------------------------------------
for some reason the value(1) in the array is repeated
is this a bug? or am I doing something wrong?