Scenario 1: Querying JSON documents in the Couchbase database by unique document IDs - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This scenario queries the JSON documents in the Couchbase database by unique document IDs. Specifically, we use the document IDs as the key to query the documents, whose contents are JSON data. The documents in the Couchbase database are shown below:

For how to write such documents to the database, see Scenario: Inserting documents to a data bucket in the Couchbase database.

Linking the components

  1. Drop tCouchbaseConnection, tCouchbaseInput, tCouchbaseClose and tLogRow onto the workspace.

  2. Link tCouchbaseConnection to tCouchbaseInput using the OnSubjobOk trigger.

  3. Link tCouchbaseInput to tLogRow using a Row > Main connection.

  4. Link tCouchbaseInput to tCouchbaseClose using the OnSubjobOk trigger.

Configuring the components

  1. Double-click tCouchbaseConnection to open its Basic settings view.

  2. In the Data Bucket field, enter the name of the data bucket in the Couchbase database.

  3. In the Password field, enter the password for access to the data bucket.

  4. In the URIs table, click the [+] button to add lines as needed, where you can enter the URIs of the Couchbase server nodes.

  5. Double-click tCouchbaseInput to open its Basic settings view.

  6. Select the Use existing connection check box to reuse the connection.

  7. In the Key field, enter the document IDs, for example "ELT Overview", "Integration at any scale".

  8. Click the Edit schema button to open the schema editor. The schema contains two pre-defined fields, Key and Value.

  9. Double-click tLogRow to open its Basic settings view.

  10. Select Table (print values in cells of a table for a better display of the results.

Executing the Job

  1. Press Ctrl + S to save the Job.

  2. Press F6 to run the Job.

    As shown above, the JSON documents with the keys (IDs) of ELT Overview and Integration at any scale are retrieved.