title: Mule- Iterating through a Map in dataweave and skipping duplicate elements
body: <p>I need to to iterate database query result in dataweave and skip duplicates as well as few elements based on some condition. Say, if vales for a column <strong>order</strong> is coming like:
  <strong>10-ord, 11-ord, 12-ord, I should be picking up only 11-ord and skip any other rows which value ends with -ord.</strong></p>
  <p>Rest of the values which does not end with -<strong>ord</strong> should be picked up.</p>
  <p>The current code gives distinct element but not the above highlighted condition. The current code is :</p>
  <pre><code>payload map ((payload, indexOfPayload) -&gt; {
  id: payload.orderId ,
  number: payload.orderNumber
  }) distinctBy $.number
  </code></pre>