{"action":"created","issue":{"url":"https://api.github.com/repos/firebase/angularfire/issues/672","labels_url":"https://api.github.com/repos/firebase/angularfire/issues/672/labels{/name}","comments_url":"https://api.github.com/repos/firebase/angularfire/issues/672/comments","events_url":"https://api.github.com/repos/firebase/angularfire/issues/672/events","html_url":"https://github.com/firebase/angularfire/issues/672","id":113657413,"number":672,"title":"Set key with $firebaseArray.$add()","user":{"login":"jaufgang","id":1747254,"avatar_url":"https://avatars.githubusercontent.com/u/1747254?v=3","gravatar_id":"","url":"https://api.github.com/users/jaufgang","html_url":"https://github.com/jaufgang","followers_url":"https://api.github.com/users/jaufgang/followers","following_url":"https://api.github.com/users/jaufgang/following{/other_user}","gists_url":"https://api.github.com/users/jaufgang/gists{/gist_id}","starred_url":"https://api.github.com/users/jaufgang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaufgang/subscriptions","organizations_url":"https://api.github.com/users/jaufgang/orgs","repos_url":"https://api.github.com/users/jaufgang/repos","events_url":"https://api.github.com/users/jaufgang/events{/privacy}","received_events_url":"https://api.github.com/users/jaufgang/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/firebase/angularfire/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-27T19:01:02Z","updated_at":"2015-10-27T19:10:16Z","closed_at":null,"body":"In certain places, I would like to be able to specify the key when using $firebaseArray.$add().  I think it would be handy to have the ability to do this added to the function.\r\n\r\nI can think of 2 different ways to allow this, either adding an $id property to the data being added and have that used as the key, or alternately calling $add(dataObject, key).  Either one of these approaches would default to the existing behaviour if no key was specified, so this change would not break any existing code.\r\n\r\nIs this something that could be added?  I could make the change and create a pull request if it would be accepted.\r\n"},"comment":{"url":"https://api.github.com/repos/firebase/angularfire/issues/comments/151613509","html_url":"https://github.com/firebase/angularfire/issues/672#issuecomment-151613509","issue_url":"https://api.github.com/repos/firebase/angularfire/issues/672","id":151613509,"user":{"login":"katowulf","id":959972,"avatar_url":"https://avatars.githubusercontent.com/u/959972?v=3","gravatar_id":"","url":"https://api.github.com/users/katowulf","html_url":"https://github.com/katowulf","followers_url":"https://api.github.com/users/katowulf/followers","following_url":"https://api.github.com/users/katowulf/following{/other_user}","gists_url":"https://api.github.com/users/katowulf/gists{/gist_id}","starred_url":"https://api.github.com/users/katowulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katowulf/subscriptions","organizations_url":"https://api.github.com/users/katowulf/orgs","repos_url":"https://api.github.com/users/katowulf/repos","events_url":"https://api.github.com/users/katowulf/events{/privacy}","received_events_url":"https://api.github.com/users/katowulf/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T19:10:16Z","updated_at":"2015-10-27T19:10:16Z","body":"Also, adding a record with a specific key can be done as follows: 'firebaseArray.$ref().child( newKey ).set(newData);'"}}