You can insert a batch array of hashes using the ruby mongo driver’s insert method. From any Mongoid class, you can call collection to access it.
batch = [{:name => "mongodb"}, {:name => "mongoid"}]
Article.collection.insert(batch)
You can insert a batch array of hashes using the ruby mongo driver’s insert method. From any Mongoid class, you can call collection to access it.
batch = [{:name => "mongodb"}, {:name => "mongoid"}]
Article.collection.insert(batch)