{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/2351","repository_url":"https://api.github.com/repos/strongloop/loopback","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/2351/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/2351/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/2351/events","html_url":"https://github.com/strongloop/loopback/issues/2351","id":155452519,"number":2351,"title":"update relation after add?","user":{"login":"upupzealot","id":2574689,"avatar_url":"https://avatars.githubusercontent.com/u/2574689?v=3","gravatar_id":"","url":"https://api.github.com/users/upupzealot","html_url":"https://github.com/upupzealot","followers_url":"https://api.github.com/users/upupzealot/followers","following_url":"https://api.github.com/users/upupzealot/following{/other_user}","gists_url":"https://api.github.com/users/upupzealot/gists{/gist_id}","starred_url":"https://api.github.com/users/upupzealot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upupzealot/subscriptions","organizations_url":"https://api.github.com/users/upupzealot/orgs","repos_url":"https://api.github.com/users/upupzealot/repos","events_url":"https://api.github.com/users/upupzealot/events{/privacy}","received_events_url":"https://api.github.com/users/upupzealot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback/labels/question","name":"question","color":"eeeeee"}],"state":"open","locked":false,"assignee":{"login":"gunjpan","id":14811089,"avatar_url":"https://avatars.githubusercontent.com/u/14811089?v=3","gravatar_id":"","url":"https://api.github.com/users/gunjpan","html_url":"https://github.com/gunjpan","followers_url":"https://api.github.com/users/gunjpan/followers","following_url":"https://api.github.com/users/gunjpan/following{/other_user}","gists_url":"https://api.github.com/users/gunjpan/gists{/gist_id}","starred_url":"https://api.github.com/users/gunjpan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunjpan/subscriptions","organizations_url":"https://api.github.com/users/gunjpan/orgs","repos_url":"https://api.github.com/users/gunjpan/repos","events_url":"https://api.github.com/users/gunjpan/events{/privacy}","received_events_url":"https://api.github.com/users/gunjpan/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-05-18T09:13:53Z","updated_at":"2016-05-20T15:28:46Z","closed_at":null,"body":"I have a model named User which has thousands of instances there.\r\nNow I add a new hasOne relation to it, hope that each of them would have an \"account\".\r\nAnd it works for new created users. \r\nBut how can I create accounts for the existed users?"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback/issues/comments/220637789","html_url":"https://github.com/strongloop/loopback/issues/2351#issuecomment-220637789","issue_url":"https://api.github.com/repos/strongloop/loopback/issues/2351","id":220637789,"user":{"login":"gunjpan","id":14811089,"avatar_url":"https://avatars.githubusercontent.com/u/14811089?v=3","gravatar_id":"","url":"https://api.github.com/users/gunjpan","html_url":"https://github.com/gunjpan","followers_url":"https://api.github.com/users/gunjpan/followers","following_url":"https://api.github.com/users/gunjpan/following{/other_user}","gists_url":"https://api.github.com/users/gunjpan/gists{/gist_id}","starred_url":"https://api.github.com/users/gunjpan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunjpan/subscriptions","organizations_url":"https://api.github.com/users/gunjpan/orgs","repos_url":"https://api.github.com/users/gunjpan/repos","events_url":"https://api.github.com/users/gunjpan/events{/privacy}","received_events_url":"https://api.github.com/users/gunjpan/received_events","type":"User","site_admin":false},"created_at":"2016-05-20T15:28:46Z","updated_at":"2016-05-20T15:28:46Z","body":"@upupzealot :\r\n>So after all I have to do that manually?\r\n\r\nyes, I believe so. \r\nAs you're adding the relation after already having Instances, by your design, it seems you want to set a generic/same account for each user w/o any account. In that case, you can iterate over the the instances - with no accounts - and set their accounts and this will be a one-time thing.\r\n\r\nHope that answers your question, please let me know if this is good to close. Thanks."}}
{"actor":{"display_login":"gunjpan"}}