drill
drill copied to clipboard
How to get a single field inside an array of assign?
I have json:
{
"count": 2,
"rows": [
{
"_id": "aaa",
"name": "AAA"
},
{
"_id": "bbb",
"name": "BBB"
}
]
}
and benchmark.yml:
- name: get all
request:
url: /get_all
assign: all
I want to get a single id, for example, this kind of:
- name: delete
request:
url: /del/{{ all.body.rows[0]._id }}
method: DELETE
The above code is not working, what should I do?
Nowadays, the json access for previous requests doesn't support array steps. But it could be a really nice addition
Maybe this merge can help you with more complex json accesses: https://github.com/fcsonline/drill/pull/114
Executing OS commands to parse json in every request would be a performance killer.
Is there a way to implement this feature or there is a design complications that prevent this?
Not super complicated, but it needs to be implemented.