Closed jabielecki closed 8 months ago
I am trying to figure out how to join two JSON inputs together. The documentation is very sparse on this, and the examples on StackOverflow sadly no longer have working demo links thanks to this issue, so this combination of factors has left me stuck...
@james-johnston-thumbtack Could you be more specific how you want to join? give example input/output maybe. Also you probably have better chance with help at https://github.com/jqlang/jq/discussions or https://discord.gg/yg6yjNmgAC
I'm guessing your looking for +
or *
(recursive merge)
$ jq -n '{a:1, b: {c: 3}} as $a | {b: {d:4}} as $b | $a + $b, $a * $b'
{
"a": 1,
"b": {
"d": 4
}
}
{
"a": 1,
"b": {
"c": 3,
"d": 4
}
}
@wader After I posted last night, I did eventually figure out how to do the joins, and even test them on jqplay. But it took some additional trial and error.
But the specifics of joining is outside the scope of this issue.
The main point I want to make is this: I found multiple StackOverflow answers with demo links that were not working any more. It was frustrating, because the answers didn't have an obviously copy/pasteable answer, yet they claimed to have it working in jqplay. It's near-certain that the authors of these answers did not realize the retention period of the demo links since the product doesn't communicate the retention period.
Aha sorry i should have read more carefully. Browsed the code a bit but don't see any obvious expire functionality. I can ping @owenthereal on discord about this issue
Browsed the code a bit but don't see any obvious expire functionality
Correct, jqplay doesn't expire any shared snippets.
Of the links I've tried today (2023-07-14), all work correctly up to about 1 year ago (2022-07-11)
This might be related to the change of cloud provider. The old data was lost because I got locked out of my work Heroku account when I left the company.
I'm closing because all comments are addressed. Feel free to reopen if there are more questions. Cheers!
I've noticed that older snippets on jqplay.org don't work for me. If it's an intentional policy to delete the shared snippets, could you warn users please? While some of them doubtlessly only create snippets for quick chats/advices, some share it permanently.
People on stackoverflow are laboriously publishing the snippet urls, hoping that they are creating knowledge base that would last for many years. Their effort is of negative value if the snippets are not permanent. (1 year positive, then N years confusion/distraction)
I think something like changing the button text from
Share snippet
toShare snippet (1 year)
would be completely sufficient.To investigate, I went to stackoverflow, searched for "jqplay", sorted by date, and examined the links posted. Of the links I've tried today (2023-07-14), all work correctly up to about 1 year ago (2022-07-11). Links to older snippets all show an empty playground.