如何删除空手道中的多个数组对象? [英] How to delete multiple array objects in karate?
本文介绍了如何删除空手道中的多个数组对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将此问题转到下一步将可以同时删除部分满足条件的多个对象.
Taking this question to the next step will it possible to delete multiple objects at the same time which partially fulfils the condition.
* def json = [ { "id": "0a7936ed", "code": "test", "label": "test", "type": "sell" }, { "id": "7bc1909b2", "code": "test2", "label": "test2", "type": "Buy" }, { "id": "7bc1909b2", "code": "test2", "label": "learn", "type": "Buy" } ]
表示要删除代码中包含测试的所有对象,即
Means to say it should delete all the object that contains test in code i.e.
code: "test" or code: "test1"
那有可能吗?
推荐答案
为此使用karate.filter()
:
查看全文