Method: Mongo::Collection#insert_many
- Defined in:
- lib/mongo/collection.rb
#insert_many(documents, options = {}) ⇒ Result
Insert the provided documents into the collection.
843 844 845 846 847 848 |
# File 'lib/mongo/collection.rb', line 843 def insert_many(documents, = {}) QueryCache.clear_namespace(namespace) inserts = documents.map{ |doc| { :insert_one => doc }} bulk_write(inserts, ) end |