类:Mongo::WriteConcern::Acknowledged

继承:
Base
  • 对象
显示全部
定义于:
lib/ Mongo/write_concern/acknowledged.rb

Overview

已确认的写关注会针对每个写入操作提供获取最后一个错误命令以及相应的选项。

由于:

  • 2.0.0

实例属性摘要

Base继承的属性

#options

实例方法摘要折叠

Base继承的方法

#initialize

构造函数详情

该类从Mongo::WriteConcern::Base继承了一个构造函数

实例方法详细信息

#已确认?true , false

此写关注(write concern)是否已确认。

例子:

此写关注(write concern)对象是否已确认。

write_concern.acknowledged?

返回:

  • ( true , false )

    此写关注(write concern)是否已得到确认。

由于:

  • 2.5.0



48
49
50
# File 'lib/ Mongo/write_concern/acknowledged.rb', line 48

def 已确认?
  true
end

#get_last_errorHash

获取关注的获取最后一个错误命令。

例子:

获取 gle 命令。

acknowledged.get_last_error

返回:

  • (哈希)

    gle 命令。

由于:

  • 2.0.0



34
35
36
37
38
# File 'lib/ Mongo/write_concern/acknowledged.rb', line 34

def get_last_error
  @get_last_error ||= { GET_LAST_ERROR => 1 }.合并(merge)(
    选项::映射器.transform_values_to_strings(选项)
  )
end

#检查string

获取已确认的写关注(write concern)的人类可读string表示形式。

例子:

检查写关注(write concern)。

write_concern.inspect

返回:

  • ( string )

    已确认写关注(write concern)的string表示形式。

由于:

  • 2.0.0



60
61
62
# File 'lib/ Mongo/write_concern/acknowledged.rb', line 60

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