{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/parse-server-example/issues/222","repository_url":"https://api.github.com/repos/ParsePlatform/parse-server-example","labels_url":"https://api.github.com/repos/ParsePlatform/parse-server-example/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-server-example/issues/222/comments","events_url":"https://api.github.com/repos/ParsePlatform/parse-server-example/issues/222/events","html_url":"https://github.com/ParsePlatform/parse-server-example/issues/222","id":161926609,"number":222,"title":"Create user ","user":{"login":"ksngits","id":13203949,"avatar_url":"https://avatars.githubusercontent.com/u/13203949?v=3","gravatar_id":"","url":"https://api.github.com/users/ksngits","html_url":"https://github.com/ksngits","followers_url":"https://api.github.com/users/ksngits/followers","following_url":"https://api.github.com/users/ksngits/following{/other_user}","gists_url":"https://api.github.com/users/ksngits/gists{/gist_id}","starred_url":"https://api.github.com/users/ksngits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksngits/subscriptions","organizations_url":"https://api.github.com/users/ksngits/orgs","repos_url":"https://api.github.com/users/ksngits/repos","events_url":"https://api.github.com/users/ksngits/events{/privacy}","received_events_url":"https://api.github.com/users/ksngits/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-23T13:45:01Z","updated_at":"2016-06-24T12:11:39Z","closed_at":"2016-06-24T12:11:03Z","body":"I am writing a init script and wanted to put default users in the parse db.\r\n\r\n```\r\n   var usr = new Parse.Object(\"User\"); // I tried _User and Parse.User but throwing exception\r\n    usr.set(\"username\", \"xyz\");\r\n    usr.set(\"email\", \"xyz@gmail.com\");\r\n    usr.set(\"password\", \"xyz\");\r\n    usr.set(\"Active\", true);\r\n    usr.save().then(function (u) { console.log(u.toJSON()); }, function (err) { console.log(err); });\r\n```\r\n\r\nWhat is the correct way to create the user in the cloud code?\r\n\r\nchanged the above code to below \r\n\r\n  ```\r\n  var usr = new Parse.User(); \r\n    usr.set(\"username\", \"xyz\");\r\n    usr.set(\"email\", \"xyz@gmail.com\");\r\n    usr.set(\"password\", \"xyz\");\r\n    usr.set(\"Active\", true);\r\n    usr.signup().then(function (u) { console.log(u.toJSON()); }, function (err) { console.log(err); });\r\n```\r\n\r\n--> Uncaught internal server error, usr,signup is not a function.\r\n\r\nSo what is the correct way to save the user object?\r\n\r\n\r\nedit:  option 2 to save user object\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ParsePlatform/parse-server-example/issues/comments/228329996","html_url":"https://github.com/ParsePlatform/parse-server-example/issues/222#issuecomment-228329996","issue_url":"https://api.github.com/repos/ParsePlatform/parse-server-example/issues/222","id":228329996,"user":{"login":"ksngits","id":13203949,"avatar_url":"https://avatars.githubusercontent.com/u/13203949?v=3","gravatar_id":"","url":"https://api.github.com/users/ksngits","html_url":"https://github.com/ksngits","followers_url":"https://api.github.com/users/ksngits/followers","following_url":"https://api.github.com/users/ksngits/following{/other_user}","gists_url":"https://api.github.com/users/ksngits/gists{/gist_id}","starred_url":"https://api.github.com/users/ksngits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksngits/subscriptions","organizations_url":"https://api.github.com/users/ksngits/orgs","repos_url":"https://api.github.com/users/ksngits/repos","events_url":"https://api.github.com/users/ksngits/events{/privacy}","received_events_url":"https://api.github.com/users/ksngits/received_events","type":"User","site_admin":false},"created_at":"2016-06-24T12:11:39Z","updated_at":"2016-06-24T12:11:39Z","body":"I had to fix the before save code and able to set the password successfully. And also signUp instead of all small cases. Thanks"}}
{"actor":{"display_login":"ksngits"}}