Answer the question
In order to leave comments, you need to log in
How to add word to jq filter output?
The filter collects new json:
jq '.comments[] | {comment:{url_slug:.post.url_slug, post_id:.post.id}}'
{
"comment": {
"url_slug": "post-solar-system",
"post_id": 555555
}
{
"comment": {
"url_slug": "post-solar-system",
"post_id": 555555
"full_url": "https://экзампл.ком/post-solar-system-555555/"
}
Answer the question
In order to leave comments, you need to log in
Something like this
full_url:("https://example.com/" + .post.url_slug + "-" + (.post.id | tostring))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question