'How to avoid MongoDbIO.read() in construction and staging of template phase?

Read read = MongoDbIO.read().withUri(options.getMongoUri()) .withBucketAuto(true).withDatabase().withCollection(); Since valueProvider is not provided for MongoDbIO.read() how to avoid connecting to database in construction of template phase ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source