File: op_msg.rb

package info (click to toggle)
ruby-mongo 2.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,020 kB
  • sloc: ruby: 110,810; makefile: 5
file content (31 lines) | stat: -rw-r--r-- 765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true

module Mongo
  module Operation
    class CreateSearchIndexes
      # A MongoDB createSearchIndexes operation sent as an op message.
      #
      # @api private
      class OpMsg < OpMsgBase
        include ExecutableTransactionLabel

        private

        # Returns the command to send to the database, describing the
        # desired createSearchIndexes operation.
        #
        # @param [ Connection ] _connection the connection that will receive the
        #   command
        #
        # @return [ Hash ] the selector
        def selector(_connection)
          {
            createSearchIndexes: coll_name,
            :$db => db_name,
            indexes: indexes,
          }
        end
      end
    end
  end
end