@@ -46,8 +46,8 @@ private int getMongoDBVersion() {
4646 private void archiveForVersion5AndAbove (Instant thresholdDate ) {
4747 log .info ("Running archival for MongoDB version >= 5" );
4848
49- MongoCollection <Document > sourceCollection = mongoTemplate .getDb ().getCollection ("applicationHistorySnapshotTS " );
50- MongoCollection <Document > targetCollection = mongoTemplate .getDb ().getCollection ("applicationHistorySnapshot " );
49+ MongoCollection <Document > sourceCollection = mongoTemplate .getDb ().getCollection ("applicationHistorySnapshot " );
50+ MongoCollection <Document > targetCollection = mongoTemplate .getDb ().getCollection ("applicationHistorySnapshotTS " );
5151
5252 long totalDocuments = sourceCollection .countDocuments (Filters .lte ("createdAt" , thresholdDate ));
5353 log .info ("Total documents to archive: {}" , totalDocuments );
@@ -91,7 +91,7 @@ private void archiveForVersion5AndAbove(Instant thresholdDate) {
9191 private void archiveForVersionBelow5 (Instant thresholdDate ) {
9292 log .info ("Running archival for MongoDB version < 5" );
9393
94- MongoCollection <Document > sourceCollection = mongoTemplate .getDb ().getCollection ("applicationHistorySnapshotTS " );
94+ MongoCollection <Document > sourceCollection = mongoTemplate .getDb ().getCollection ("applicationHistorySnapshot " );
9595
9696 long totalDocuments = sourceCollection .countDocuments (Filters .lte ("createdAt" , thresholdDate ));
9797 log .info ("Total documents to archive: {}" , totalDocuments );
@@ -119,7 +119,7 @@ private void archiveForVersionBelow5(Instant thresholdDate) {
119119 .append ("modifiedBy" , document .get ("modifiedBy" ))
120120 .append ("updatedAt" , document .get ("updatedAt" ))
121121 .append ("id" , document .get ("id" ))),
122- new Document ("$out" , "applicationHistorySnapshot " )
122+ new Document ("$out" , "applicationHistorySnapshotTS " )
123123 )).first ();
124124 } catch (Exception e ) {
125125 log .error ("Failed to aggregate and insert document with ID {}. Error: {}" , document .getObjectId ("id" ), e .getMessage ());
0 commit comments