def insert(documents, flags = nil)
      with_retry(cluster) do
        docs = documents.is_a?(Array) ? documents : [ documents ]
        cluster.with_primary do |node|
          node.insert(database.name, name, docs, write_concern, flags: flags || [])
        end
      end
    end
def insert(documents, flags = nil)
      with_retry(cluster) do
        docs = documents.is_a?(Array) ? documents : [ documents ]
        cluster.with_primary do |node|
          node.insert(database.name, name, docs, write_concern, flags: flags || [])
        end
      end
    end
Initialize the new collection.

 @example Initialize the collection.
   Collection.new(database, :artists)

 @param [ Database ] database The collection's database.
 @param [ String, Symbol] name The collection name.

 @since 1.0.0
 Insert one or more documents into the collection.

 @example Insert a single document.
   db[:people].insert(name: "John")

 @example Insert multiple documents in batch.
   db[:people].insert([{name: "John"}, {name: "Joe"}])

 @param [ Hash, Array<Hash> ] documents The document(s) to insert.
 @param [ Array ] flags The flags, valid values are :continue_on_error.

 @option options [Array] :continue_on_error Whether to continue on error.

 @return [ nil ] nil.

 @since 1.0.0