{"action":"created","issue":{"url":"https://api.github.com/repos/stedolan/jq/issues/677","labels_url":"https://api.github.com/repos/stedolan/jq/issues/677/labels{/name}","comments_url":"https://api.github.com/repos/stedolan/jq/issues/677/comments","events_url":"https://api.github.com/repos/stedolan/jq/issues/677/events","html_url":"https://github.com/stedolan/jq/issues/677","id":55638109,"number":677,"title":"Is it possible to add a random selector?","user":{"login":"ashleycoker","id":895340,"avatar_url":"https://avatars.githubusercontent.com/u/895340?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleycoker","html_url":"https://github.com/ashleycoker","followers_url":"https://api.github.com/users/ashleycoker/followers","following_url":"https://api.github.com/users/ashleycoker/following{/other_user}","gists_url":"https://api.github.com/users/ashleycoker/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleycoker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleycoker/subscriptions","organizations_url":"https://api.github.com/users/ashleycoker/orgs","repos_url":"https://api.github.com/users/ashleycoker/repos","events_url":"https://api.github.com/users/ashleycoker/events{/privacy}","received_events_url":"https://api.github.com/users/ashleycoker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-27T16:14:40Z","updated_at":"2015-01-28T23:00:22Z","closed_at":null,"body":"Take this as an example:\r\n\r\n`\r\ncurl 'https://query.yahooapis.com/v1/public/yql?q=SELECT%20*%20FROM%20xml%20WHERE%20url%3D%22http%3A%2F%2Fopenmenu.com%2Fmenu%2F21573c8e-15bb-11e0-b40e-0018512e6b26%22&format=json' | jq '[.query.results.omf.menus.menu.menu_groups.menu_group[].menu_items.menu_item[] | {title: .menu_item_name, price: .menu_item_price, desc: .menu_item_description, type: \"food\"}]'\r\n`\r\n\r\nI would like to be able to add another field to the resulting object \"related\" which is a random number of random selections of the other titles.  For example a single object in the resulting array may look like:\r\n\r\n    {\r\n       \"title\": \"FRESH SNOWPEAS\",\r\n       \"price\": \"123\",\r\n       \"desc\": \"a desc\",\r\n       \"type\": \"food\",\r\n       \"related\": [{\"title\": \"SAUTEED SPINACH\"}, {\"title\": \"CRIMINI MUSHROOMS\"}]\r\n    }\r\n\r\nThe related field must not contain itself, and must contain between say 1 and 5 other items.\r\n\r\nI have read ALL the docs and cant find any way to select at random?  Surely it must be possible?\r\nThanks in advance\r\n"},"comment":{"url":"https://api.github.com/repos/stedolan/jq/issues/comments/71935169","html_url":"https://github.com/stedolan/jq/issues/677#issuecomment-71935169","issue_url":"https://api.github.com/repos/stedolan/jq/issues/677","id":71935169,"user":{"login":"ashleycoker","id":895340,"avatar_url":"https://avatars.githubusercontent.com/u/895340?v=3","gravatar_id":"","url":"https://api.github.com/users/ashleycoker","html_url":"https://github.com/ashleycoker","followers_url":"https://api.github.com/users/ashleycoker/followers","following_url":"https://api.github.com/users/ashleycoker/following{/other_user}","gists_url":"https://api.github.com/users/ashleycoker/gists{/gist_id}","starred_url":"https://api.github.com/users/ashleycoker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashleycoker/subscriptions","organizations_url":"https://api.github.com/users/ashleycoker/orgs","repos_url":"https://api.github.com/users/ashleycoker/repos","events_url":"https://api.github.com/users/ashleycoker/events{/privacy}","received_events_url":"https://api.github.com/users/ashleycoker/received_events","type":"User","site_admin":false},"created_at":"2015-01-28T23:00:22Z","updated_at":"2015-01-28T23:00:22Z","body":"any ideas on this one?  Thanks"}}