Let’s say I have the following array:
#let arr = (
(a: "foo", b: "not bar", c: "baz"),
(a: "qux", b: "quux", c: "corge"),
(a: "fizz", b: "buzz", c: "fizzbuzz"),
(a: "foo", b: "bar", c: "baz"),
)
I now want to sort this array fist by the key a
of the contained dictionary and then by the key b
. using #arr.sorted(key: it => it.a)
only sorts by the first key. If they are the same, like in line 1 and 4, I then want to sort by key b
within this subgroub, such that the result would be:
(
(a: "fizz", b: "buzz", c: "fizzbuzz"),
(a: "foo", b: "bar", c: "baz"),
(a: "foo", b: "not bar", c: "baz"),
(a: "qux", b: "quux", c: "corge"),
)
How can I achieve this sorting?