Exam MCD - Level 1 All QuestionsBrowse all questions from this exam
Question 47

What does the minus operator do in DataWeave?

    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
Kokulan1763Option: B

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

EsquerdoOption: B

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

ilya_tsy

page does not exist

abhhiiiiiiiOption: B

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

Ella_ZOption: B

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

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

edilberto1Option: B

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.

ck0241Option: B

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

edilberto1

Otherwise response must said that it subtract from other value