Module Mongo::WriteConcern
In: lib/mongo/write_concern.rb
lib/mongo/write_concern/unacknowledged.rb
lib/mongo/write_concern/base.rb
lib/mongo/write_concern/acknowledged.rb

Base module for all write concern specific behavior.

@since 2.0.0

Methods

get  

Classes and Modules

Class Mongo::WriteConcern::Acknowledged
Class Mongo::WriteConcern::Base
Class Mongo::WriteConcern::Unacknowledged

Constants

W = :w.freeze   The number of servers write concern.

@since 2.0.0

J = :j.freeze   The journal write concern.

@since 2.0.0

FSYNC = :fsync.freeze   The file sync write concern.

@since 2.0.0

WTIMEOUT = :wtimeout.freeze   The wtimeout write concern.

@since 2.0.0

GET_LAST_ERROR = :getlasterror.freeze   The GLE command name.

@since 2.0.0

DEFAULT = { }.freeze   The default write concern is to acknowledge on a single server.

@since 2.0.0

Public Instance methods

Create a write concern object for the provided options.

@example Get a write concern.

  Mongo::WriteConcern.get(:w => 1)

@param [ Hash ] options The options to instantiate with.

@option options :w [ Integer, String ] The number of servers or the

  custom mode to acknowledge.

@option options :j [ true, false ] Whether to acknowledge a write to

  the journal.

@option options :fsync [ true, false ] Should the write be synced to

  disc.

@option options :wtimeout [ Integer ] The number of milliseconds to

  wait for acknowledgement before raising an error.

@return [ Unacknowledged, Acknowledged ] The appropriate concern.

@raise [ Error::InvalidWriteConcern ] If the options are invalid.

@since 2.0.0

[Validate]