class Mongo::Operation::Explain::OpMsg

A MongoDB explain operation sent as an op message.

@api private

@since 2.5.2

Private Instance Methods

selector(connection) click to toggle source
# File lib/mongo/operation/explain/op_msg.rb, line 33
def selector(connection)
  # The mappings are BSON::Documents and as such store keys as
  # strings, the spec here has symbol keys.
  spec = BSON::Document.new(self.spec)
  {
    explain: {
      find: coll_name,
    }.update(Find::Builder::Command.selector(spec, connection)),
    Protocol::Msg::DATABASE_IDENTIFIER => db_name,
  }.update(spec[:explain] || {})
end