类:Mongo::Protocol::Reply

继承:
message
  • 对象
显示全部
定义于:
lib/ Mongo/ 协议/ reply.rb

Overview

代表回复的MongoDB传输协议消息

例子:

socket = TCPSocket.new('localhost', 27017)
query = Protocol::Query.new('xgen', 'users', {:name => 'Tyler'})
socket.write(query)
reply = Protocol::Reply::deserialize(socket)

在命名空间下定义

类: 上转换器

常量摘要

Message继承的常量

Message::BATCH_SIZEMessage::COLLECTIONMessage::LIMITMessage::MAX_MESSAGE_SIZEMessage::ORDEREDMessage::Q

序列化器中包含的常量

Serializers::HEADER_PACKSerializers::INT32_PACKSerializers::INT64_PACKSerializers::NULLSerializers::ZERO

实例属性摘要

Message继承的属性

#request_id

实例方法摘要折叠

Message继承的方法

#==, deserialize, deserialize_array, deserialize_field, deserialize_header, 字段, 字段, #hash, #initialize, #maybe_add_server_api, #maybe_compress, #maybe_decrypt, #maybe_encrypt, #maybe_inflate, #replyable?, #serialize, #set_request_id

ID中包含的方法

包含

构造函数详情

该类从Mongo::Protocol::Message继承了一个构造函数

实例方法详细信息

# cursor_not_Found?true , false

确定回复是否具有未找到游标标志。

例子:

回复是否有未找到游标标志。

reply.cursor_not_found?

返回:

  • ( true , false )

    如果未找到查询游标。

由于:

  • 2.2.3



49
50
51
# File 'lib/ Mongo/ 协议/reply.rb', line 49

def cursor_not_Found?
  flags.包括?(:cursor_not_Found)
end

#有效负载BSON::Document

返回用于监控的事件负载。

例子:

返回事件有效负载。

message.payload

返回:

  • ( BSON::Document )

    事件有效负载。

由于:

  • 2.1.0



61
62
63
64
65
66
# File 'lib/ Mongo/ 协议/reply.rb', line 61

def 有效负载
  BSON::文档.new(
    回复: 上转换器.命令,
    request_id: request_id
  )
end

# query_failure?true , false

确定回复是否具有查询失败标志。

例子:

回复是否有查询失败。

reply.query_failure?

返回:

  • ( true , false )

    如果查询失败。

由于:

  • 2.0.5



37
38
39
# File 'lib/ Mongo/ 协议/reply.rb', line 37

def query_failure?
  flags.包括?(:query_failure)
end