# File lib/moped/collection.rb, line 124 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