Class MongoMigration

java.lang.Object
org.jobrunr.storage.nosql.mongo.migrations.MongoMigration
Direct Known Subclasses:
M001_CreateJobCollection, M002_CreateRecurringJobCollection, M003_CreateBackgroundJobServerCollection, M004_CreateJobStatsCollection, M005_CreateMetadataCollectionAndDropJobStats, M006_UpdateRecurringJobsCollectionAddCreatedAtIndex, M007_UpdateJobsCollectionReplaceIndices, M007_UpdateJobsCollectionReplaceIndices

public abstract class MongoMigration extends Object
  • Constructor Details

    • MongoMigration

      public MongoMigration()
  • Method Details

    • runMigration

      public abstract void runMigration(com.mongodb.client.MongoDatabase mongoDatabase, String collectionPrefix)
    • createCollection

      protected boolean createCollection(com.mongodb.client.MongoDatabase mongoDatabase, String name)
    • collectionExists

      protected boolean collectionExists(com.mongodb.client.MongoDatabase mongoDatabase, String collectionName)
    • dropIndexes

      protected void dropIndexes(com.mongodb.client.MongoCollection<org.bson.Document> mongoCollection)
    • createIndex

      protected void createIndex(com.mongodb.client.MongoCollection<org.bson.Document> mongoCollection, org.bson.conversions.Bson index, com.mongodb.client.model.IndexOptions indexOptions)
    • isBackgroundOperationInProgressException

      protected Boolean isBackgroundOperationInProgressException(RuntimeException e)