Mule 4 Exam QuestionsBrowse all questions from this exam

Mule 4 Exam - Question 47


What does the minus operator do in DataWeave?

Show Answer
Correct Answer: B

In DataWeave, the minus operator is used to remove items from a list. When applied to an array, it removes the specified elements. This usage aligns with DataWeave's approach to data manipulation where operators are often overloaded to work with collections in addition to their traditional arithmetic roles.

Discussion

6 comments
Sign in to comment
Esquerdo
EsquerdoOption: B
Aug 8, 2024

removes an iten from an array https://docs.mulesoft.com/dataweave/2.4/dw-operators

ilya_tsy
ilya_tsy
Sep 8, 2024

page does not exist

Kokulan1763
Kokulan1763
Aug 29, 2024

If we apply to array. it will remove element. EX: [1,2,3] - 2 ==> o/p ==>[1,3] If we apply to number, it will decrease by 1. EX: 5-1 ==> o/p ==> 4

ck0241
ck0241
Jul 15, 2023

Why is it removes item from list? It could also be decrements by right?

edilberto1
edilberto1
Jul 29, 2023

Otherwise response must said that it subtract from other value

edilberto1
edilberto1
Jul 29, 2023

It is in the reference guide at https://docs.mulesoft.com/mule-runtime/4.3/dw-operators Prepend, Append, and Remove Operators for Arrays section, it isn't used as an arithmetic operator into this scope.

Ella_Z
Ella_Z
Sep 4, 2023

Looks A&B are correct, but maybe "by one" leads to incorrect? I am not sure. https://docs.mulesoft.com/mule-runtime/4.3/dw-operators 1. For subtraction. 2. Removes a specified element of any supported type from an array.

Sephyre1988
Sephyre1988
May 30, 2024

if I'm not mistaken "- -" will decrease a number value not a single "-"

abhhiiiiiii
abhhiiiiiii
Oct 18, 2024

hello the letter B is a change in perspective of fellow harry potter enthusiats aka SIRUS my best mate