{"action":"created","issue":{"url":"https://api.github.com/repos/bazaarvoice/jolt/issues/286","repository_url":"https://api.github.com/repos/bazaarvoice/jolt","labels_url":"https://api.github.com/repos/bazaarvoice/jolt/issues/286/labels{/name}","comments_url":"https://api.github.com/repos/bazaarvoice/jolt/issues/286/comments","events_url":"https://api.github.com/repos/bazaarvoice/jolt/issues/286/events","html_url":"https://github.com/bazaarvoice/jolt/issues/286","id":187430219,"number":286,"title":"Remove duplicates or distinct Json files based on a field using Jolt transformation","user":{"login":"srinvias","id":6714331,"avatar_url":"https://avatars.githubusercontent.com/u/6714331?v=3","gravatar_id":"","url":"https://api.github.com/users/srinvias","html_url":"https://github.com/srinvias","followers_url":"https://api.github.com/users/srinvias/followers","following_url":"https://api.github.com/users/srinvias/following{/other_user}","gists_url":"https://api.github.com/users/srinvias/gists{/gist_id}","starred_url":"https://api.github.com/users/srinvias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srinvias/subscriptions","organizations_url":"https://api.github.com/users/srinvias/orgs","repos_url":"https://api.github.com/users/srinvias/repos","events_url":"https://api.github.com/users/srinvias/events{/privacy}","received_events_url":"https://api.github.com/users/srinvias/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-04T20:25:31Z","updated_at":"2016-11-05T03:47:45Z","closed_at":null,"body":"I am trying to remove duplicate json records from json array using Jolt transformation . \r\nHere is an example i tried : \r\nInput : \r\n```\r\n[\r\n\t{\r\n\t\t\"id\": 1,\r\n\t\t\"name\": \"jeorge\",\r\n\t\t\"age\": 25\r\n\t},\r\n\t{\r\n\t\t\"id\": 2,\r\n\t\t\"name\": \"manhan\",\r\n\t\t\"age\": 25\r\n\t},\r\n\t{\r\n\t\t\"id\": 1,\r\n\t\t\"name\": \"george\",\r\n\t\t\"age\": 225\r\n\t}\r\n]\r\n```\r\n\r\nJolt script : \r\n```\r\n[\r\n  {\r\n    \"operation\": \"shift\",\r\n    \"spec\": {\r\n      \"*\": {\r\n        \"id\": \"[&1].id\"\r\n      }\r\n    }\r\n  }\r\n]\r\n```\r\nOutput  : \r\n```\r\n[ {\r\n  \"id\" : 1\r\n}, {\r\n  \"id\" : 2\r\n}, {\r\n  \"id\" : 1\r\n} ]\r\n```\r\ngetting only selected records . along with that , i would like to remove duplicates .\r\nDesired Output : \r\n```\r\n[ {\r\n  \"id\" : 1\r\n}, {\r\n  \"id\" : 2\r\n} ] \r\n```\r\nPlease provide the necessary script which will help me . Thanks in advance . \r\n"},"comment":{"url":"https://api.github.com/repos/bazaarvoice/jolt/issues/comments/258588762","html_url":"https://github.com/bazaarvoice/jolt/issues/286#issuecomment-258588762","issue_url":"https://api.github.com/repos/bazaarvoice/jolt/issues/286","id":258588762,"user":{"login":"srinvias","id":6714331,"avatar_url":"https://avatars.githubusercontent.com/u/6714331?v=3","gravatar_id":"","url":"https://api.github.com/users/srinvias","html_url":"https://github.com/srinvias","followers_url":"https://api.github.com/users/srinvias/followers","following_url":"https://api.github.com/users/srinvias/following{/other_user}","gists_url":"https://api.github.com/users/srinvias/gists{/gist_id}","starred_url":"https://api.github.com/users/srinvias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srinvias/subscriptions","organizations_url":"https://api.github.com/users/srinvias/orgs","repos_url":"https://api.github.com/users/srinvias/repos","events_url":"https://api.github.com/users/srinvias/events{/privacy}","received_events_url":"https://api.github.com/users/srinvias/received_events","type":"User","site_admin":false},"created_at":"2016-11-05T03:47:45Z","updated_at":"2016-11-05T03:47:45Z","body":"Thank you @milosimpson \r\nIs it able to delete duplicate Json record in array of JSONs ? If yes . May i know what will be the script ?"}}
{"actor":{"display_login":"srinvias"}}