title: Dataweave - Filter if a field value is null or not
body: <p>I read a file that contains a <code>JSON Array</code> like this:</p>
  
  <pre><code>[
     {
        "example":{
           "name":"edward",
           "lastName":"espin"
        },
        "error":"That name doesn't exists"
     },
     {
        "example":{
           "name":"toretto",
           "lastName":"brav"
        },
        "error":null
     }
  ]
  </code></pre>
  
  <p>I want to store in a new file <strong>only the records which the error value is not null</strong> using the same format.</p>
  
  <p>I have used a <code>for-each</code> that runs through each JSON and inside, checks if that JSON does not have the "error" field with null value (<code>payload.error != null</code>). </p>
  
  <p>The problem is that I use a <code>for-each</code> and in a <code>choice</code>.</p>
  
  <p><strong>The output expected must be:</strong></p>
  
  <pre><code>[
     {
        "example":{
           "name":"edward",
           "lastName":"espin"
        },
        "error":"That name doesn't exists"
     }
  ]
  </code></pre>
  
  <p>Is there a simpler way with a <strong>transformation component</strong> and <strong>Dataweave 2</strong>?</p>