I have the following JSON structure:
[
{
"stack": [
"datasync"
],
"env": [
"dev",
"test"
],
"runOnBranch": [
"feature/",
"bugfix/",
"develop"
]
},
{
"stack": [
"datasync"
],
"env": [
"val",
"prod"
],
"runOnBranch": [
"main"
]
}
]
And I would like to filter the list based on if a given string starts with one of the strings defined in the runOnBranch
attribute.
My best guess so far doesn't work:
[?runOnBranch.starts_with(@, `feature/`) == `true`]
The error I get is:
"Search parse error": TypeError: starts_with() expected argument 1 to be type 2 but received type 3 instead.
The result I would like to get is:
[
{
"stack": [
"datasync"
],
"env": [
"dev",
"test"
],
"runOnBranch": [
"feature/",
"bugfix/",
"develop"
]
}
]
What am I missing?