Using UNSET inside a Set with Xano Transform

I'm trying to learn the Xano Transform syntax and playing around with creating a single top level array of objects by merging an array with a nested subarray. It's all working perfectly except I'd like to remove that subarray property from the objects that contain it.

Granted, this is simple enough by dropping a map filter on the returned data but I really was hoping it could be done all within the expression.

Here's what I currently have for context

$$.tag_groups.tags.sub_tags | merge : $$.tag_groups.tags | unset : $1.sub_tags | filter_empty

I've tried using $1.sub_tags, sub_tags, & "sub_tags" as the argument for the unset filter but it makes no difference to the returned data.

6 replies