Question 11
Choose 1
Refer to the exhibit. What is the output of logger component?


Correct answer:
C. Array
Explanation:
The flow processes data through three components before reaching the Logger:
Listener: This component receives the inbound request and starts the flow.
Select (Database Connector): This component executes a database query (implied by the name and icon). In Mule 4, when the Database Select operation executes a query, the output payload is, by default, a list of maps (or objects), where each map represents a row returned from the database. This data structure is represented in DataWeave as an Array (of Objects).
Logger: This component's configuration uses the DataWeave expression:
$$#[typeOf(payload)]
The typeOf() function inspects the data type of the current payload.
Since the payload entering the Logger is the default output of a Select database operation, which is an Array of records, the typeOf(payload) function will return the String value representing the array type (e.g., "Array" or a more specific array type string).
The question asks for the output of the logger component, which is the value of the message it logs. The value being logged is the string name of the payload's type, which is Array. Therefore, the conceptual output logged by the component is related to the Array data type. In the context of a multiple-choice exam asking about the result of typeOf(payload) after a database select, the expected answer is the type of the payload itself, which is an Array.
❌ Incorrect Answers:
A. String: A String is the literal output of the typeOf() function (e.g., the string "Array"), but the question implies what type the payload is. The payload itself is an Array.
B. Object: An Object (Map) represents a single record. Since the database select operation returns multiple rows, the overall payload is a collection of these objects, i.e., an Array.
D. Map: A Map is the Mule/DataWeave representation of a single key-value pair structure, which is what each item in the array is. The overall payload, however, is an Array of these Maps.
📚 References:
For detailed information on the default output structure of database operations, refer to the official MuleSoft documentation:
Database Connector Output: The documentation for the Select operation of the Mule 4 Database Connector states that the output message payload is typically a List
The flow processes data through three components before reaching the Logger:
Listener: This component receives the inbound request and starts the flow.
Select (Database Connector): This component executes a database query (implied by the name and icon). In Mule 4, when the Database Select operation executes a query, the output payload is, by default, a list of maps (or objects), where each map represents a row returned from the database. This data structure is represented in DataWeave as an Array (of Objects).
Logger: This component's configuration uses the DataWeave expression:
$$#[typeOf(payload)]
The typeOf() function inspects the data type of the current payload.
Since the payload entering the Logger is the default output of a Select database operation, which is an Array of records, the typeOf(payload) function will return the String value representing the array type (e.g., "Array" or a more specific array type string).
The question asks for the output of the logger component, which is the value of the message it logs. The value being logged is the string name of the payload's type, which is Array. Therefore, the conceptual output logged by the component is related to the Array data type. In the context of a multiple-choice exam asking about the result of typeOf(payload) after a database select, the expected answer is the type of the payload itself, which is an Array.
❌ Incorrect Answers:
A. String: A String is the literal output of the typeOf() function (e.g., the string "Array"), but the question implies what type the payload is. The payload itself is an Array.
B. Object: An Object (Map) represents a single record. Since the database select operation returns multiple rows, the overall payload is a collection of these objects, i.e., an Array.
D. Map: A Map is the Mule/DataWeave representation of a single key-value pair structure, which is what each item in the array is. The overall payload, however, is an Array of these Maps.
📚 References:
For detailed information on the default output structure of database operations, refer to the official MuleSoft documentation:
Database Connector Output: The documentation for the Select operation of the Mule 4 Database Connector states that the output message payload is typically a List





