Class: Mongo::Database::CursorCommandView Private
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | lib/mongo/database/cursor_command_view.rb |
Overview
The minimal view a ::Mongo::Cursor needs when it is built from an arbitrary
command response rather than from a collection query.
It carries the getMore-specific options (batchSize, maxTimeMS, comment)
and the cursor type and timeout mode, and answers the few methods the
::Mongo::Cursor reads from its view.
Class Method Summary
- .new(database, options = {}) ⇒ CursorCommandView constructor Internal use only
Instance Attribute Summary
- #database ⇒ Mongo::Database readonly Internal use only
- #options ⇒ Hash readonly Internal use only
Instance Method Summary
- #batch_size ⇒ Integer | nil Internal use only
- #client ⇒ Mongo::Client Internal use only
-
#collection ⇒ Mongo::Collection
Internal use only
A placeholder collection used only so the
::Mongo::Cursorcan reach the client and database. - #cursor_type ⇒ Symbol | nil Internal use only
- #max_time_ms_for_get_more ⇒ Integer | nil Internal use only
- #operation_timeouts(opts = {}) ⇒ Hash Internal use only
- #timeout_mode ⇒ Symbol | nil Internal use only
-
#limit
private
Internal use only
Cursors do not support a limit when built from a command response.
Constructor Details
.new(database, options = {}) ⇒ CursorCommandView
Instance Attribute Details
#database ⇒ Mongo::Database (readonly)
# File 'lib/mongo/database/cursor_command_view.rb', line 42
attr_reader :database
#options ⇒ Hash (readonly)
# File 'lib/mongo/database/cursor_command_view.rb', line 46
attr_reader :
Instance Method Details
#batch_size ⇒ Integer | nil
# File 'lib/mongo/database/cursor_command_view.rb', line 63
def batch_size [:batch_size] end
#client ⇒ Mongo::Client
# File 'lib/mongo/database/cursor_command_view.rb', line 49
def client database.client end
#collection ⇒ Mongo::Collection
A placeholder collection used only so the ::Mongo::Cursor can reach the client
and database. The actual namespace for getMore and killCursors is taken
from the command response, not from this collection.
# File 'lib/mongo/database/cursor_command_view.rb', line 58
def collection @collection ||= Collection.new(database, '$cmd') end
#cursor_type ⇒ Symbol | nil
# File 'lib/mongo/database/cursor_command_view.rb', line 73
def cursor_type [:cursor_type] end
#limit (private)
Cursors do not support a limit when built from a command response.
# File 'lib/mongo/database/cursor_command_view.rb', line 90
def limit nil end
#max_time_ms_for_get_more ⇒ Integer | nil
# File 'lib/mongo/database/cursor_command_view.rb', line 68
def max_time_ms_for_get_more [:max_time_ms] end
#operation_timeouts(opts = {}) ⇒ Hash
# File 'lib/mongo/database/cursor_command_view.rb', line 83
def operation_timeouts(opts = {}) database.operation_timeouts(opts) end
#timeout_mode ⇒ Symbol | nil
# File 'lib/mongo/database/cursor_command_view.rb', line 78
def timeout_mode [:timeout_mode] end