{"action":"created","issue":{"url":"https://api.github.com/repos/AcornHack/Acorn-Connect-Academy/issues/2","repository_url":"https://api.github.com/repos/AcornHack/Acorn-Connect-Academy","labels_url":"https://api.github.com/repos/AcornHack/Acorn-Connect-Academy/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/AcornHack/Acorn-Connect-Academy/issues/2/comments","events_url":"https://api.github.com/repos/AcornHack/Acorn-Connect-Academy/issues/2/events","html_url":"https://github.com/AcornHack/Acorn-Connect-Academy/issues/2","id":245714908,"number":2,"title":"CODE ISN'T WORKING PROPERLY AAAAAHHHHH","user":{"login":"ApCoder123","id":20560218,"avatar_url":"https://avatars0.githubusercontent.com/u/20560218?v=4","gravatar_id":"","url":"https://api.github.com/users/ApCoder123","html_url":"https://github.com/ApCoder123","followers_url":"https://api.github.com/users/ApCoder123/followers","following_url":"https://api.github.com/users/ApCoder123/following{/other_user}","gists_url":"https://api.github.com/users/ApCoder123/gists{/gist_id}","starred_url":"https://api.github.com/users/ApCoder123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ApCoder123/subscriptions","organizations_url":"https://api.github.com/users/ApCoder123/orgs","repos_url":"https://api.github.com/users/ApCoder123/repos","events_url":"https://api.github.com/users/ApCoder123/events{/privacy}","received_events_url":"https://api.github.com/users/ApCoder123/received_events","type":"User","site_admin":false},"labels":[{"id":655362498,"url":"https://api.github.com/repos/AcornHack/Acorn-Connect-Academy/labels/api","name":"api","color":"fbca04","default":false},{"id":577172654,"url":"https://api.github.com/repos/AcornHack/Acorn-Connect-Academy/labels/bug","name":"bug","color":"ee0701","default":true},{"id":577172657,"url":"https://api.github.com/repos/AcornHack/Acorn-Connect-Academy/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-26T13:03:29Z","updated_at":"2017-07-26T18:01:48Z","closed_at":null,"body":"This code is supposed to add a new collaborator to an array. BUT for some reason, it is adding the number 1 when I try to add a collaborator:\r\n```\r\nrouter.put('/:id/addCollaborator', function (req, res) {\r\n\r\n    if(req.params.collaborators!==undefined){\r\n        collaborators = new Array()\r\n        Project.findByIdAndUpdate(req.params.id, {\r\n\r\n            $set: {\r\n                \"collaborators\": collaborators.push(req.params.collaborators)\r\n                //\"numOfCollaborators\": collaborators.length\r\n\r\n            }}).exec(function(err, project){\r\n            if(err) {\r\n                console.log(err);\r\n                res.status(500).send(err);\r\n            } else {\r\n                res.status(200).send(project);\r\n            }\r\n        });\r\n    }else if(req.params.collaborators==undefined){\r\n        collaborators = new Array()\r\n        Project.findByIdAndUpdate(req.params.id, {\r\n            $set: {\r\n                \"collaborators\": collaborators.push(req.params.collaborators)\r\n            }}).exec(function(err, project){\r\n            if(err) {\r\n                console.log(err);\r\n                res.status(500).send(err);\r\n            } else {\r\n                res.status(200).send(project);\r\n            }\r\n        });\r\n    }\r\n\r\n    });\r\n```"},"comment":{"url":"https://api.github.com/repos/AcornHack/Acorn-Connect-Academy/issues/comments/318134437","html_url":"https://github.com/AcornHack/Acorn-Connect-Academy/issues/2#issuecomment-318134437","issue_url":"https://api.github.com/repos/AcornHack/Acorn-Connect-Academy/issues/2","id":318134437,"user":{"login":"ApCoder123","id":20560218,"avatar_url":"https://avatars0.githubusercontent.com/u/20560218?v=4","gravatar_id":"","url":"https://api.github.com/users/ApCoder123","html_url":"https://github.com/ApCoder123","followers_url":"https://api.github.com/users/ApCoder123/followers","following_url":"https://api.github.com/users/ApCoder123/following{/other_user}","gists_url":"https://api.github.com/users/ApCoder123/gists{/gist_id}","starred_url":"https://api.github.com/users/ApCoder123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ApCoder123/subscriptions","organizations_url":"https://api.github.com/users/ApCoder123/orgs","repos_url":"https://api.github.com/users/ApCoder123/repos","events_url":"https://api.github.com/users/ApCoder123/events{/privacy}","received_events_url":"https://api.github.com/users/ApCoder123/received_events","type":"User","site_admin":false},"created_at":"2017-07-26T18:01:48Z","updated_at":"2017-07-26T18:01:48Z","body":"@eddiejaoude This is the type in the Mongoose Schema: `collaborators: [[String]]`\r\n"}}
{"actor":{"display_login":"ApCoder123"}}