Class: Moped::Protocol::GetMore
- Includes:
- Message
- Defined in:
- lib/moped/protocol/get_more.rb
Overview
The Protocol class for retrieving more documents from a cursor.
Instance Attribute Summary collapse
-
#collection ⇒ String, Symbol
readonly
The collection this insert targets.
-
#cursor_id ⇒ Number
The id of the cursor to get more documents from.
-
#database ⇒ String, Symbol
readonly
The database this insert targets.
-
#full_collection_name ⇒ String
The namespaced collection name.
-
#length ⇒ Number
The length of the message.
-
#limit ⇒ Number
The number of documents to return.
-
#op_code ⇒ Number
OP_GETMORE operation code (2005).
-
#request_id ⇒ Number
The request id of the message.
Instance Method Summary collapse
-
#initialize(database, collection, cursor_id, limit, options = {}) ⇒ GetMore
constructor
Create a new
GetMore
command. - #log_inspect ⇒ Object
-
#receive_replies(connection) ⇒ Protocol::Reply
Receive replies to the message.
Methods included from Message
included, #inspect, #serialize
Constructor Details
#initialize(database, collection, cursor_id, limit, options = {}) ⇒ GetMore
Create a new GetMore
command. The database
and collection
arguments are joined together to set the full_collection_name
.
65 66 67 68 69 70 71 72 73 |
# File 'lib/moped/protocol/get_more.rb', line 65 def initialize(database, collection, cursor_id, limit, = {}) @database = database @collection = collection @full_collection_name = "#{database}.#{collection}" @cursor_id = cursor_id @limit = limit @request_id = [:request_id] end |
Instance Attribute Details
#collection ⇒ String, Symbol (readonly)
Returns the collection this insert targets.
58 59 60 |
# File 'lib/moped/protocol/get_more.rb', line 58 def collection @collection end |
#cursor_id ⇒ Number
Returns the id of the cursor to get more documents from.
44 |
# File 'lib/moped/protocol/get_more.rb', line 44 int64 :cursor_id |
#database ⇒ String, Symbol (readonly)
Returns the database this insert targets.
55 56 57 |
# File 'lib/moped/protocol/get_more.rb', line 55 def database @database end |
#full_collection_name ⇒ String
Returns the namespaced collection name.
36 |
# File 'lib/moped/protocol/get_more.rb', line 36 cstring :full_collection_name |
#length ⇒ Number
Returns the length of the message.
20 |
# File 'lib/moped/protocol/get_more.rb', line 20 int32 :length |
#limit ⇒ Number
Returns the number of documents to return.
40 |
# File 'lib/moped/protocol/get_more.rb', line 40 int32 :limit |
#op_code ⇒ Number
Returns OP_GETMORE operation code (2005).
30 |
# File 'lib/moped/protocol/get_more.rb', line 30 int32 :op_code |
#request_id ⇒ Number
Returns the request id of the message.
24 |
# File 'lib/moped/protocol/get_more.rb', line 24 int32 :request_id |
Instance Method Details
#log_inspect ⇒ Object
75 76 77 78 |
# File 'lib/moped/protocol/get_more.rb', line 75 def log_inspect type = "GET_MORE" "%-12s database=%s collection=%s limit=%s cursor_id=%s" % [type, database, collection, limit, cursor_id] end |
#receive_replies(connection) ⇒ Protocol::Reply
Receive replies to the message.
90 91 92 |
# File 'lib/moped/protocol/get_more.rb', line 90 def receive_replies(connection) connection.read end |