Hi
This seems to work for me:
> db['things'].create_index("name", :unique => true)
> documents = [{:name => "First"}, {:name => "Second"}]
> db['things'].insert(documents, :continue_on_error => true, :safe => false)
in the mongo shell:
> db.things.find()
{ "_id" : ObjectId("501a9cf13005c82ac9000001"), "name" : "First" }
{ "_id" : ObjectId("501a9cf13005c82ac9000002"), "name" : "Second" }
> documents = [{:name => "First"}, {:name => "Third"}]
> db['things'].insert(documents, :continue_on_error => true, :safe => false)
in the mongo shell:
> db.things.find()
{ "_id" : ObjectId("501a9cf13005c82ac9000001"), "name" : "First" }
{ "_id" : ObjectId("501a9cf13005c82ac9000002"), "name" : "Second" }
{ "_id" : ObjectId("501a9d173005c82ac9000004"), "name" : "Third" }
You shouldn't be getting an exception if you use :safe => false
What version of Mongoid are you using?