Downloading files from MongoDB GridFS - Cloud - 8.0

MongoDB

Version
Cloud
8.0
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > NoSQL components > MongoDB components
Data Quality and Preparation > Third-party systems > NoSQL components > MongoDB components
Design and Development > Third-party systems > NoSQL components > MongoDB components
Last publication date
2024-02-20

Procedure

  1. Double-click tMongoDBGridFSGet to open its Component view.
  2. Select the Use existing connection check box and from the Connection list, select the component in which the MongoDB connection to be used is defined.
  3. In the Bucket field, enter the bucket in which the files to be retrieved are stored. In this example, it is talend_channel/61.
  4. In the Local folder field, enter the path to the local folder in which you want to store the downloaded files. In this scenario, it is C:/tmp/output.
  5. Select the Use Document ID as output filename check box to rename each downloaded file using the value of its ObjectID attribute.
    Since a file in GridFS is distinct by ID rather than by name, it is possible that several files are using the same file name. For this reason, when downloading this kind of files into the same directory without renaming them differently, an exception is returned to alert that the file being downloaded already exists. In order to avoid this error, you can either select the Overwrite local files check box to replace the existing one with the latest downloaded file or rename these files on the fly using their IDs. In this example, the strategy of renaming these files is adopted.