Method: Mongo::Session#retry_writes?

Defined in:
lib/mongo/session.rb

#retry_writes?true, false

Note:

Retryable writes are only available on server versions at least 3.6 and with sharded clusters, replica sets, or load-balanced topologies.

Will writes executed with this session be retried.

Examples:

Will writes be retried.

session.retry_writes?

Returns:

  • (true, false)

    If writes will be retried.

Since:

  • 2.5.0



215
216
217
# File 'lib/mongo/session.rb', line 215

def retry_writes?
  !!client.options[:retry_writes] && (cluster.replica_set? || cluster.sharded? || cluster.load_balanced?)
end