{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1528","repository_url":"https://api.github.com/repos/strongloop/loopback","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1528/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1528/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1528/events","html_url":"https://github.com/strongloop/loopback/issues/1528","id":95528708,"number":1528,"title":"[Docs] Incorrect callback arguments in PersistedModel#findOrCreate","user":{"login":"Jhoanegar","id":5821213,"avatar_url":"https://avatars.githubusercontent.com/u/5821213?v=3","gravatar_id":"","url":"https://api.github.com/users/Jhoanegar","html_url":"https://github.com/Jhoanegar","followers_url":"https://api.github.com/users/Jhoanegar/followers","following_url":"https://api.github.com/users/Jhoanegar/following{/other_user}","gists_url":"https://api.github.com/users/Jhoanegar/gists{/gist_id}","starred_url":"https://api.github.com/users/Jhoanegar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jhoanegar/subscriptions","organizations_url":"https://api.github.com/users/Jhoanegar/orgs","repos_url":"https://api.github.com/users/Jhoanegar/repos","events_url":"https://api.github.com/users/Jhoanegar/events{/privacy}","received_events_url":"https://api.github.com/users/Jhoanegar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback/labels/doc","name":"doc","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":{"login":"crandmck","id":2925364,"avatar_url":"https://avatars.githubusercontent.com/u/2925364?v=3","gravatar_id":"","url":"https://api.github.com/users/crandmck","html_url":"https://github.com/crandmck","followers_url":"https://api.github.com/users/crandmck/followers","following_url":"https://api.github.com/users/crandmck/following{/other_user}","gists_url":"https://api.github.com/users/crandmck/gists{/gist_id}","starred_url":"https://api.github.com/users/crandmck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crandmck/subscriptions","organizations_url":"https://api.github.com/users/crandmck/orgs","repos_url":"https://api.github.com/users/crandmck/repos","events_url":"https://api.github.com/users/crandmck/events{/privacy}","received_events_url":"https://api.github.com/users/crandmck/received_events","type":"User","site_admin":false},"milestone":null,"comments":12,"created_at":"2015-07-16T21:03:01Z","updated_at":"2016-02-03T02:59:32Z","closed_at":"2016-02-03T02:59:32Z","body":"Hi, I was reading the docs and I found that the documentation for the `findOrCreate` method in `PersistedModel` is wrong. It states that the callback function has 2 arguments, `error ` and `instance`, as you can see here.\r\nhttp://apidocs.strongloop.com/loopback/v/2.14.0/#persistedmodel-findorcreate\r\n\r\nAccording to my tests, the callback function actually gets three arguments, `(error, created, instance)`, where `created` is `true` if the instance was just created or `false` if it was found.\r\n\r\nI'm using loopback's version `2.14.0` but, unless the signature changed in the latest version, I see the same mistake in the latest docs. That or I'm overlooking something.\r\n\r\nKeep the awesome work.\r\nCheers."},"comment":{"url":"https://api.github.com/repos/strongloop/loopback/issues/comments/178974210","html_url":"https://github.com/strongloop/loopback/issues/1528#issuecomment-178974210","issue_url":"https://api.github.com/repos/strongloop/loopback/issues/1528","id":178974210,"user":{"login":"superkhau","id":1617364,"avatar_url":"https://avatars.githubusercontent.com/u/1617364?v=3","gravatar_id":"","url":"https://api.github.com/users/superkhau","html_url":"https://github.com/superkhau","followers_url":"https://api.github.com/users/superkhau/followers","following_url":"https://api.github.com/users/superkhau/following{/other_user}","gists_url":"https://api.github.com/users/superkhau/gists{/gist_id}","starred_url":"https://api.github.com/users/superkhau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superkhau/subscriptions","organizations_url":"https://api.github.com/users/superkhau/orgs","repos_url":"https://api.github.com/users/superkhau/repos","events_url":"https://api.github.com/users/superkhau/events{/privacy}","received_events_url":"https://api.github.com/users/superkhau/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T02:59:32Z","updated_at":"2016-02-03T02:59:32Z","body":"Closing since #1983 has been merged already. Please open a new issue if you guy are still running into problems."}}