类:Mongo::数据库::CursorCommandView Private
- 继承:
-
对象
- 对象
- Mongo::Database::CursorCommandView
- 定义于:
- lib/mongo/数据库/cursor_command_view.rb
Overview
此类是私有 API 的一部分。 应尽可能避免使用此类,因为它将来可能会被删除或更改。
当游标是从任意命令响应而不是从集合查询构建时,它所需的最小视图。
它携带 getMore 特定选项(batchSize、maxTimeMS、comment)、游标类型和超时模式,并回答游标从其视图中读取的几个方法。
实例属性摘要折叠
-
#数据库⇒ Mongo::Database
只读
private
命令运行所在的数据库。
-
# options ⇒ 哈希
只读
private
视图选项。
实例方法摘要折叠
-
#batch_size ⇒ Integer | nil
private
在 getMore 命令上发送的 batchSize。
-
#客户端⇒ Mongo::Client
private
客户端。
-
# 集合 ⇒ Mongo::Collection
private
仅用于游标能够访问客户端和数据库的占位符集合。
-
#cursor_type ⇒ Symbol | nil
private
游标类型。
-
#initialize(database, options = {}) ⇒ CursorCommandView
构造函数
private
CursorCommandView 的新实例。
-
#limit ⇒ Object
private
从命令响应构建的游标不支持限制。
-
#max_time_ms_for_get_more ⇒ 整数 | nil
private
在 getMore 命令上发送的 maxTimeMS。
-
# operation_timeups (opts = {}) ⇒ 哈希
private
操作上下文的超时值。
-
#timeout_mode ⇒ Symbol | nil
private
超时模式。
构造函数详情
#initialize(database, options = {}) ⇒ CursorCommandView
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回 CursorCommandView 的新实例。
36 37 38 39 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 36 行 def 初始化(database, = {}) @database = database @options = end |
实例属性详细信息
#数据库⇒ Mongo::Database (readonly)
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回命令运行所在的数据库。
42 43 44 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 42 行 def database @database end |
# options ⇒哈希(只读)
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回 视图选项。由游标用于读取 getMore 评论。
46 47 48 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 46 行 def @options end |
实例方法详细信息
#batch_size ⇒ Integer | nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回在 getMore 命令上发送的 batchSize。
63 64 65 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 63 行 def batch_size [:batch_size] end |
#客户端 ⇒ Mongo::Client
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回客户端。
49 50 51 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 49 行 def 客户端 database.客户端 end |
#集合 ⇒ Mongo::Collection
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
仅用于使游标可以访问客户端和数据库的占位符集合。getMore 和 killCursors 的实际命名空间来自命令响应,而不是来自此集合。
58 59 60 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 58 行 def 集合 @collection ||= Collection.new(database, '$cmd') end |
#cursor_type ⇒ Symbol | nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回游标类型。
73 74 75 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 73 行 def cursor_type [:cursor_type] end |
#limit ⇒ Object
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
从命令响应构建的游标不支持限制。
90 91 92 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 90 行 def limit nil end |
#max_time_ms_for_get_more ⇒ 整数 | nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回在 getMore 命令上发送的 maxTimeMS。
68 69 70 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 68 行 def max_time_ms_for_get_more [:max_time_ms] end |
# operation_timeups (opts = {}) ⇒ 哈希
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回操作上下文的超时值。
83 84 85 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 83 行 def operation_timeups(opts = {}) database.operation_timeups(opts) end |
#timeout_mode ⇒ Symbol | nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回超时模式。
78 79 80 |
# 文件 'lib/mongo/数据库/cursor_command_view.rb', 第 78 行 def timeout_mode [:timeout_mode] end |