{"action":"created","comment":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/comments/26855752","id":26855752,"diff_hunk":"@@ -1413,11 +1413,17 @@ DataAccessObject.removeById = DataAccessObject.destroyById = DataAccessObject.de\n \n   var Model = this;\n \n-  this.remove(byIdQuery(this, id).where, options, function(err) {\n+  this.remove(byIdQuery(this, id).where, options, function(err, data) {\n+    var deleted = data && data.count > 0;\n     if ('function' === typeof cb) {\n-      cb(err);\n+      if (options.reportFailureAsError && !err && !deleted) {\n+        err = new Error('No instance with id ' + id + ' found for ' + Model.modelName);\n+        cb(err, false);\n+      } else {\n+        cb(err, deleted);","path":"lib/dao.js","position":13,"original_position":13,"commit_id":"bc8f9356da5bac7302987ba0387ebf40683c3502","original_commit_id":"bc8f9356da5bac7302987ba0387ebf40683c3502","user":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"body":"Returning a `true/false` value is an anti-pattern and it is also difficult to extend. I am proposing to send an object instead.","created_at":"2015-03-20T16:58:09Z","updated_at":"2015-03-20T16:58:09Z","html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/521#discussion_r26855752","pull_request_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/521","_links":{"self":{"href":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/comments/26855752"},"html":{"href":"https://github.com/strongloop/loopback-datasource-juggler/pull/521#discussion_r26855752"},"pull_request":{"href":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/521"}}},"pull_request":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/521","id":31631339,"html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/521","diff_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/521.diff","patch_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/521.patch","issue_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/521","number":521,"state":"open","locked":false,"title":"Return true/false result for destroyById/prototype.destroy","user":{"login":"fabien","id":2749,"avatar_url":"https://avatars.githubusercontent.com/u/2749?v=3","gravatar_id":"","url":"https://api.github.com/users/fabien","html_url":"https://github.com/fabien","followers_url":"https://api.github.com/users/fabien/followers","following_url":"https://api.github.com/users/fabien/following{/other_user}","gists_url":"https://api.github.com/users/fabien/gists{/gist_id}","starred_url":"https://api.github.com/users/fabien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabien/subscriptions","organizations_url":"https://api.github.com/users/fabien/orgs","repos_url":"https://api.github.com/users/fabien/repos","events_url":"https://api.github.com/users/fabien/events{/privacy}","received_events_url":"https://api.github.com/users/fabien/received_events","type":"User","site_admin":false},"body":"See also: #321 - note that the memory connector has been fixed to have `destroy` also return `{ count: 1 }` feedback - this should also be done with the other connectors.\r\n\r\n/cc @raymondfeng @bajtos @superkhau ","created_at":"2015-03-20T16:52:06Z","updated_at":"2015-03-20T16:58:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f17bedb26cce9f11f34dcedcf9a83802ed9827a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/521/commits","review_comments_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/521/comments","review_comment_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/521/comments","statuses_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/statuses/bc8f9356da5bac7302987ba0387ebf40683c3502","head":{"label":"fabien:feature/delete-feedback","ref":"feature/delete-feedback","sha":"bc8f9356da5bac7302987ba0387ebf40683c3502","user":{"login":"fabien","id":2749,"avatar_url":"https://avatars.githubusercontent.com/u/2749?v=3","gravatar_id":"","url":"https://api.github.com/users/fabien","html_url":"https://github.com/fabien","followers_url":"https://api.github.com/users/fabien/followers","following_url":"https://api.github.com/users/fabien/following{/other_user}","gists_url":"https://api.github.com/users/fabien/gists{/gist_id}","starred_url":"https://api.github.com/users/fabien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabien/subscriptions","organizations_url":"https://api.github.com/users/fabien/orgs","repos_url":"https://api.github.com/users/fabien/repos","events_url":"https://api.github.com/users/fabien/events{/privacy}","received_events_url":"https://api.github.com/users/fabien/received_events","type":"User","site_admin":false},"repo":{"id":21730554,"name":"loopback-datasource-juggler","full_name":"fabien/loopback-datasource-juggler","owner":{"login":"fabien","id":2749,"avatar_url":"https://avatars.githubusercontent.com/u/2749?v=3","gravatar_id":"","url":"https://api.github.com/users/fabien","html_url":"https://github.com/fabien","followers_url":"https://api.github.com/users/fabien/followers","following_url":"https://api.github.com/users/fabien/following{/other_user}","gists_url":"https://api.github.com/users/fabien/gists{/gist_id}","starred_url":"https://api.github.com/users/fabien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabien/subscriptions","organizations_url":"https://api.github.com/users/fabien/orgs","repos_url":"https://api.github.com/users/fabien/repos","events_url":"https://api.github.com/users/fabien/events{/privacy}","received_events_url":"https://api.github.com/users/fabien/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fabien/loopback-datasource-juggler","description":"Connect Loopback to various Data Sources","fork":true,"url":"https://api.github.com/repos/fabien/loopback-datasource-juggler","forks_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/forks","keys_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/teams","hooks_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/hooks","issue_events_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/issues/events{/number}","events_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/events","assignees_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/assignees{/user}","branches_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/branches{/branch}","tags_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/tags","blobs_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/statuses/{sha}","languages_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/languages","stargazers_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/stargazers","contributors_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/contributors","subscribers_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/subscribers","subscription_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/subscription","commits_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/contents/{+path}","compare_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/merges","archive_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/downloads","issues_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/issues{/number}","pulls_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/pulls{/number}","milestones_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/milestones{/number}","notifications_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/labels{/name}","releases_url":"https://api.github.com/repos/fabien/loopback-datasource-juggler/releases{/id}","created_at":"2014-07-11T09:33:08Z","updated_at":"2014-07-22T20:09:50Z","pushed_at":"2015-03-20T16:49:47Z","git_url":"git://github.com/fabien/loopback-datasource-juggler.git","ssh_url":"git@github.com:fabien/loopback-datasource-juggler.git","clone_url":"https://github.com/fabien/loopback-datasource-juggler.git","svn_url":"https://github.com/fabien/loopback-datasource-juggler","homepage":"www.strongloop.com","size":4857,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"strongloop:master","ref":"master","sha":"112f2bd65286da4291f93f2ceb414d69480f4ab8","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":10126908,"name":"loopback-datasource-juggler","full_name":"strongloop/loopback-datasource-juggler","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/loopback-datasource-juggler","description":"Connect Loopback to various Data Sources","fork":false,"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler","forks_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/forks","keys_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/teams","hooks_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/hooks","issue_events_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/events","assignees_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/tags","blobs_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/languages","stargazers_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/stargazers","contributors_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/contributors","subscribers_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/subscribers","subscription_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/subscription","commits_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/merges","archive_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/downloads","issues_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/releases{/id}","created_at":"2013-05-17T15:56:04Z","updated_at":"2015-03-20T07:55:54Z","pushed_at":"2015-03-20T16:52:06Z","git_url":"git://github.com/strongloop/loopback-datasource-juggler.git","ssh_url":"git@github.com:strongloop/loopback-datasource-juggler.git","clone_url":"https://github.com/strongloop/loopback-datasource-juggler.git","svn_url":"https://github.com/strongloop/loopback-datasource-juggler","homepage":"www.strongloop.com","size":10369,"stargazers_count":59,"watchers_count":59,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":66,"mirror_url":null,"open_issues_count":105,"forks":66,"open_issues":105,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/521"},"html":{"href":"https://github.com/strongloop/loopback-datasource-juggler/pull/521"},"issue":{"href":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/521"},"comments":{"href":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/521/comments"},"review_comments":{"href":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/521/comments"},"review_comment":{"href":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/521/commits"},"statuses":{"href":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/statuses/bc8f9356da5bac7302987ba0387ebf40683c3502"}}}}