Classe: Mongo::Protocol::KillCursors::Upconverter
- Herda:
-
Objeto
- Objeto
- Mongo::Protocol::KillCursors::Upconverter
- Definido em:
- lib/mongo/protocol/kill_cursors.rb
Visão geral
Converte mensagens de inserção legado para a mensagem de estilo OP_COMMAND apropriada.
Recolhimento do Resumo do atributo de instância
-
#collection ➤ string
Somente leitura
Collection O nome da collection.
-
#cursor_ids ⇒ Array<Integer>
Somente leitura
Cursor_ids As IDs do cursor.
Recolhimento do Resumo do método de instância
-
#command ➤ BSON::Document
Obtenha o comando convertido.
-
#initialize(collection, cursor_ids) ➤ Upconverter
construtor
Instancie o upconverter.
Detalhes do construtor
#initialize(collection, cursor_ids) ➤ Upconverter
Instancie o upconverter.
100 101 102 103 |
# File 'lib/mongo/protocol/kill_cursors.rb', linha 100 def inicializar(collection, cursor_ids) @collection = collection @cursor_ids = cursor_ids end |
Detalhes do atributo da instância
#collection ➤ string (somente leitura)
Retorna collection O nome da collection.
86 87 88 |
# File 'lib/mongo/protocol/kill_cursors.rb', linha 86 def collection @collection end |
#cursor_ids ➤ Array<Integer> (somente leitura)
Retorna cursor_ids As IDs do cursor.
89 90 91 |
# File 'lib/mongo/protocol/kill_cursors.rb', linha 89 def cursor_ids @cursor_ids end |
Detalhes do método de instância
#command ⇒ BSON::Document
Obtenha o comando convertido.
113 114 115 116 117 118 119 120 121 |
# File 'lib/mongo/protocol/kill_cursors.rb', linha 113 def comando documento = BSON::Documento.Novo documento.Armazenar('killCursors', collection) store_ids = cursor_ids.map fazer |cursor_id| BSON::Int64.Novo(cursor_id) end documento.Armazenar('cursors', store_ids) documento end |