lib/mongo/server/connection_common.rb
# Build a command that should be used for connection handshake.
#
# @param [ BSON::Document ] handshake_document Document that should be
#   sent to a server for handshake purpose.
#
# @return [ Protocol::Message ] Command that should be sent to a server
#   for handshake purposes.
#
# @api private
Build a command that should be used for connection handshake.
Build a command that should be used for connection handshake .
def handshake_command(handshake_document)
        if handshake_document['apiVersion']
          Protocol::Msg.new(
            [], {}, handshake_document.merge({'$db' => Database::ADMIN})
          )
        else
          Protocol::Query.new(
            Database::ADMIN,
            Database::COMMAND,
            handshake_document,
            :limit => -1
          )
        end
      end
def handshake_command ( handshake_document ) if handshake_document [ 'apiVersion' ] Protocol :: Msg . new ( [ ] , { } , handshake_document . merge ( { '$db' => Database :: ADMIN } ) ) else Protocol :: Query . new ( Database :: ADMIN , Database :: COMMAND , handshake_document , :limit => - 1 ) end end
Build a command that should be used for connection handshake.
Build a command that should be used for connection handshake .
Command that should be sent to a server for handshake purposes.
Command that should be sent to a server for handshake purposes .
 Protocol::Message 
handshake_document
handshake_document Document that should be sent to a server for handshake purpose.
handshake_document Document that should be sent to a server for handshake purpose .
api
None