lib/rails/mongoid.rb
# Remove indexes that exist in the database but aren't specified on the
# models.
#
# @example Remove undefined indexes.
#   Rails::Mongoid.remove_undefined_indexes
#
# @return [ Hash{Class => Array(Hash)}] The list of indexes that were removed by model.
#
# @since 4.0.0
Remove indexes that exist in the database but aren't specified on the
models.
Remove indexes that exist in the database but aren ' t specified on the models .
def remove_undefined_indexes
      undefined_indexes.each do |model, indexes|
        indexes.each do |index|
          key = index['key'].symbolize_keys
          model.collection.indexes.drop(key)
          logger.info("MONGOID: Removing index: #{index['name']} on #{model}.")
        end
      end
    end
def remove_undefined_indexes undefined_indexes . each do | model , indexes | indexes . each do | index | key = index [ 'key' ] . symbolize_keys model . collection . indexes . drop ( key ) logger . info ( "MONGOID: Removing index: #{index['name']} on #{model}." ) end end end
Remove indexes that exist in the database but aren't specified on the
models.
Remove indexes that exist in the database but aren ' t specified on the models .
The list of indexes that were removed by model.
The list of indexes that were removed by model .
 Hash{Class => Array(Hash)}
example
Remove undefined indexes. Rails::Mongoid.remove_undefined_indexes
Remove undefined indexes . Rails :: Mongoid . remove_undefined_indexes
since
None