Sha256: 09a0f04a86893dad78dbe5720b6f07121477f064638c913777011f211db6258d

Contents?: true

Size: 870 Bytes

Versions: 5

Compression:

Stored size: 870 Bytes

Contents

# frozen_string_literal: true

module Mongo
  module Operation
    class UpdateSearchIndex
      # A MongoDB updateSearchIndex 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 updateSearchIndex operation.
        #
        # @param [ Mongo::Server ] _server the server that will receive the
        #   command
        #
        # @return [ Hash ] the selector
        def selector(_server)
          {
            updateSearchIndex: coll_name,
            :$db => db_name,
            definition: index,
          }.tap do |sel|
            sel[:id] = index_id if index_id
            sel[:name] = index_name if index_name
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mongo-2.20.1 lib/mongo/operation/update_search_index/op_msg.rb
mogno-2.20.0 lib/mongo/operation/update_search_index/op_msg.rb
mogno-1.0.0 lib/mongo/operation/update_search_index/op_msg.rb
mongo-2.20.0 lib/mongo/operation/update_search_index/op_msg.rb
mongo-2.19.3 lib/mongo/operation/update_search_index/op_msg.rb