class Mongo::Operation::Write::Command::CreateIndex

A MongoDB ensure index write command operation.

@example Create an ensure index command operation.

Write::Command::CreateIndex.new({
  :indexes => [{ :key => { :foo => 1 }, :name => 'foo_1', :unique => true }],
  :db_name => 'test',
  :coll_name => 'test_coll'
})

@since 2.0.0

Private Instance Methods

selector() click to toggle source

The query selector for this ensure index command operation.

@return [ Hash ] The selector describing this insert operation.

@since 2.0.0

# File lib/mongo/operation/write/command/create_index.rb, line 41
def selector
  { :createIndexes => coll_name, :indexes => indexes }
end