Class: Mongo::Protocol::Reply
- Defined in:
- lib/mongo/protocol/reply.rb
Overview
The MongoDB wire protocol message representing a reply
Defined Under Namespace
Classes: Upconverter
Constant Summary
Constants inherited from Message
Message::BATCH_SIZE, Message::COLLECTION, Message::LIMIT, Message::MAX_MESSAGE_SIZE, Message::ORDERED, Message::Q
Instance Attribute Summary collapse
-
#cursor_id ⇒ Fixnum
The cursor id for this response.
-
#documents ⇒ Array<Hash>
The documents in this Reply.
-
#flags ⇒ Array<Symbol>
The flags for this reply.
-
#number_returned ⇒ Fixnum
Number of documents in this Reply.
-
#starting_from ⇒ Fixnum
The starting position of the cursor for this Reply.
Attributes inherited from Message
Instance Method Summary collapse
-
#payload ⇒ Hash
Return the event payload for monitoring.
-
#query_failure? ⇒ true, false
Determine if the reply had a query failure flag.
Methods inherited from Message
#==, deserialize, #hash, #replyable?, #serialize, #set_request_id
Instance Attribute Details
#cursor_id ⇒ Fixnum
Returns The cursor id for this response. Will be zero if there are no additional results.
85 |
# File 'lib/mongo/protocol/reply.rb', line 85 field :cursor_id, Int64 |
#documents ⇒ Array<Hash>
Returns The documents in this Reply.
97 |
# File 'lib/mongo/protocol/reply.rb', line 97 field :documents, Document, :@number_returned |
#flags ⇒ Array<Symbol>
Returns The flags for this reply.
Supported flags: :cursor_not_found
, :query_failure
, :shard_config_stale
, :await_capable
.
80 |
# File 'lib/mongo/protocol/reply.rb', line 80 field :flags, BitVector.new(FLAGS) |
#number_returned ⇒ Fixnum
Returns Number of documents in this Reply.
93 |
# File 'lib/mongo/protocol/reply.rb', line 93 field :number_returned, Int32 |
#starting_from ⇒ Fixnum
Returns The starting position of the cursor for this Reply.
89 |
# File 'lib/mongo/protocol/reply.rb', line 89 field :starting_from, Int32 |
Instance Method Details
#payload ⇒ Hash
Return the event payload for monitoring.
49 50 51 |
# File 'lib/mongo/protocol/reply.rb', line 49 def payload { reply: upconverter.command, request_id: request_id } end |
#query_failure? ⇒ true, false
Determine if the reply had a query failure flag.
37 38 39 |
# File 'lib/mongo/protocol/reply.rb', line 37 def query_failure? flags.include?(:query_failure) end |