Caused by: com.mongodb.MongoCommandException: Command failed with error 257 (TransactionTooLarge): 'Total size of all transaction operations must be less than 16793600. Actual size is 16794824' on
if you saw above issue,
that means documents you are trying to save/update in one transaction is more than 16M.
with Mongo 4.0, you have not solution to fix that.
you have to update to 4.2 which doesn't have the limite