lib/rocket_job/sliced/slices.rb
# Index for find_and_modify only if it is not already present
Index for find_and_modify only if it is not already present
Index for find_and_modify only if it is not already present
def create_indexes
        all.collection.indexes.create_one(state: 1, _id: 1) if all.collection.indexes.none? { |i| i['name'] == 'state_1__id_1' }
      rescue Mongo::Error::OperationFailure
        all.collection.indexes.create_one(state: 1, _id: 1)
      end
def create_indexes all . collection . indexes . create_one ( state : 1 , _id : 1 ) if all . collection . indexes . none? { | i | i [ 'name' ] == 'state_1__id_1' } rescue Mongo :: Error :: OperationFailure all . collection . indexes . create_one ( state : 1 , _id : 1 ) end
Index for find_and_modify only if it is not already present
Index for find_and_modify only if it is not already present