123456789_123456789_123456789_123456789_123456789_

Class: Mongo::WriteConcern::Acknowledged

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Base
Instance Chain:
self, Base
Inherits: Mongo::WriteConcern::Base
Defined in: lib/mongo/write_concern/acknowledged.rb

Overview

An acknowledged write concern provides a get last error command with the appropriate options on each write operation.

Since:

  • 2.0.0

Class Method Summary

Base - Inherited

.new

Instantiate a new write concern given the options.

Instance Attribute Summary

Base - Inherited

Instance Method Summary

Instance Attribute Details

#acknowledged?true, false (readonly)

Is this write concern acknowledged.

Examples:

Whether this write concern object is acknowledged.

write_concern.acknowledged?

Returns:

  • (true, false)

    Whether this write concern is acknowledged.

Since:

  • 2.5.0

[ GitHub ]

  
# File 'lib/mongo/write_concern/acknowledged.rb', line 48

def acknowledged?
  true
end

Instance Method Details

#get_last_errorHash

Get the get last error command for the concern.

Examples:

Get the gle command.

acknowledged.get_last_error

Returns:

  • (Hash)

    The gle command.

Since:

  • 2.0.0

[ GitHub ]

  
# File 'lib/mongo/write_concern/acknowledged.rb', line 34

def get_last_error
  @get_last_error ||= { GET_LAST_ERROR => 1 }.merge(
    Options::Mapper.transform_values_to_strings(options)
  )
end

#inspectString

Get a human-readable string representation of an acknowledged write concern.

Examples:

Inspect the write concern.

write_concern.inspect

Returns:

  • (String)

    A string representation of an acknowledged write concern.

Since:

  • 2.0.0

[ GitHub ]

  
# File 'lib/mongo/write_concern/acknowledged.rb', line 60

def inspect
  "#<Mongo::WriteConcern::Acknowledged:0x#{object_id} options=#{options}>"
end