WriteConcern — Documentation by YARD 0.9.37 (original) (raw)

Module: Mongo::WriteConcern

Extended by:

WriteConcern

Included in:

WriteConcern

Defined in:

lib/mongo/write_concern.rb,
lib/mongo/write_concern/base.rb,
lib/mongo/write_concern/acknowledged.rb,
lib/mongo/write_concern/unacknowledged.rb

Overview

Base module for all write concern specific behavior.

Defined Under Namespace

Classes: Acknowledged, Base, Unacknowledged

Constant Summarycollapse

W =

The number of servers write concern.

:w.freeze

J =

The journal write concern.

:j.freeze

FSYNC =

The file sync write concern.

:fsync.freeze

WTIMEOUT =

The wtimeout write concern.

:wtimeout.freeze

GET_LAST_ERROR =

:getlasterror.freeze

DEFAULT =

The default write concern is to acknowledge on a single server.

{ }.freeze

Instance Method Summarycollapse

Instance Method Details

#get(options) ⇒ nil | Unacknowledged | Acknowledged

Create a write concern object for the provided options.

If options are nil, returns nil.

| 88 89 90 91 92 93 94 95 96 97 | # File 'lib/mongo/write_concern.rb', line 88 def get(options) return options if options.is_a?(Base) if options if (options[:w] || options['w']) == 0 Unacknowledged.new(options) else Acknowledged.new(options) end end end | | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |