res object that is available inside the vars, assertions, scripting and testing contexts can be queried for data by invoking it like below.
Think of it as lodash.get() on steroids
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Bruno V4 includes potentially breaking changes for existing users. Read more for details.
res object that is available inside the vars, assertions, scripting and testing contexts can be queried for data by invoking it like below.
Think of it as lodash.get() on steroids
res('order.total')
const data = {
customer: {
address: {
city: "bangalore"
},
orders: [
{
id: "order-1",
items: [
{ id: 1, amount: 10 },
{ id: 2, amount: 20 }
]
},
{
id: "order-2",
items: [
{ id: 3, amount: 30 },
{ id: 4, amount: 40 }
]
}
]
},
};
| Query | Output | |
|---|---|---|
| res(“customer.address.city”) | bangalore | |
| res(“customer.orders.items.amount”) | [10, 20, 30, 40] | |
| res(“customer.orders.items.amount[0]“) | 10 | |
| res(“..items.amount”) | [10, 20, 30, 40] | |
| res(“..amount”) | [10, 20, 30, 40] | |
| res(“..items.amount[0]“) | 10 | |
| res(“..items[0].amount”) | 10 | |
| res(“..items[5].amount”) | undefined | |
| res(“..id”) | [“order-1”, 1, 2, “order-2”, 3, 4] | |
| res(“customer.orders.foo”) | undefined | |
| res(“..customer.foo”) | undefined | |
| res(“..address”) | [{ city: “bangalore” }] | |
| res(“..address[0]”) | { city: “bangalore” } |
res('customer.orders.items.amount')
res('..items.amount')
res('..items[0].amount')
res('..items[?].amount', i => i.amount > 20)
res('..items..amount[?]', amt => amt + 10)