MongoCollection < BsonDocument > getUndoCollection ( final MongoNamespace namespace ) { return localClient . getDatabase ( String . format ( "sync_undo_%s" , namespace . getDatabaseName ( ) ) ) . getCollection ( namespace . getCollectionName ( ) , BsonDocument . class ) . withCodecRegistry ( MongoClientSettings . getDefaultCodecRegistry ( ) ) ; }
Returns the undo collection representing the given namespace for recording documents that may need to be reverted after a system failure .