lib/mongo/collection.rb
# Insert the provided documents into the collection.
#
# @example Insert documents into the collection.
#   collection.insert_many([{ name: 'test' }])
#
# @param [ Array<Hash> ] documents The documents to insert.
# @param [ Hash ] options The insert options.
#
# @option options [ true | false ] :ordered Whether the operations
#   should be executed in order.
# @option options [ Session ] :session The session to use for the operation.
#
# @return [ Result ] The database response wrapper.
#
# @since 2.0.0
Insert the provided documents into the collection.
Insert the provided documents into the collection .
def insert_many(documents, options = {})
      QueryCache.clear_namespace(namespace)
      inserts = documents.map{ |doc| { :insert_one => doc }}
      bulk_write(inserts, options)
    end
def insert_many ( documents , options = { } ) QueryCache . clear_namespace ( namespace ) inserts = documents . map { | doc | { :insert_one => doc } } bulk_write ( inserts , options ) end
Insert the provided documents into the collection.
Insert the provided documents into the collection .
The database response wrapper.
The database response wrapper .
 Result 
documents
<not_specific>
options
:session The session to use for the operation.
: session The session to use for the operation .
<not_specific>
options The insert options.
options The insert options .
example
Insert documents into the collection. collection.insert_many([{ name: 'test' }])
Insert documents into the collection . collection . insert_many ( [ { name : ' test ' } ] )
since
None