title: How to remove an object from an jsonarray based on filter in karate
body: <p>I want to remove an object from json array based on a filter, tried below code but didn't work</p>
  
  <pre><code>* def json = [ { "id": "0a7936ed", "code": "test", "label": "test", "type": "sell" }, { "id": "7bc1909b2", "code": "test2", "label": "test2", "type": "Buy" } ]
  </code></pre>
  
  <p>I want remove object where code is equal to test</p>
  
  <pre><code>* def fun = function(){ karate.remove('json', $.[?(@.code=='test')]") }
  * call fun
  </code></pre>
  
  <p>Getting exception as below:</p>
  
  <pre><code>com.intuit.karate.exception.KarateException: javascript function call failed: String index out of range: -1
      at com.intuit.karate.Script.evalFunctionCall(Script.java:1622)
      at com.intuit.karate.Script.call(Script.java:1573)
      at com.intuit.karate.Script.callAndUpdateConfigAndAlsoVarsIfMapReturned(Script.java:1690)
      at com.intuit.karate.StepDefs.callAndUpdateConfigAndVars(StepDefs.java:582)
  </code></pre>
  
  <p>Please suggest me how to filter it and remove the object.
  Thanks inadvance..</p>