{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/waterline/issues/1076","labels_url":"https://api.github.com/repos/balderdashy/waterline/issues/1076/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/waterline/issues/1076/comments","events_url":"https://api.github.com/repos/balderdashy/waterline/issues/1076/events","html_url":"https://github.com/balderdashy/waterline/pull/1076","id":92689462,"number":1076,"title":"Return empty/zero from IN w/empty array","user":{"login":"slester","id":104014,"avatar_url":"https://avatars.githubusercontent.com/u/104014?v=3","gravatar_id":"","url":"https://api.github.com/users/slester","html_url":"https://github.com/slester","followers_url":"https://api.github.com/users/slester/followers","following_url":"https://api.github.com/users/slester/following{/other_user}","gists_url":"https://api.github.com/users/slester/gists{/gist_id}","starred_url":"https://api.github.com/users/slester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slester/subscriptions","organizations_url":"https://api.github.com/users/slester/orgs","repos_url":"https://api.github.com/users/slester/repos","events_url":"https://api.github.com/users/slester/events{/privacy}","received_events_url":"https://api.github.com/users/slester/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/balderdashy/waterline/labels/bug","name":"bug","color":"800000"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-07-02T17:24:30Z","updated_at":"2015-07-08T23:02:32Z","closed_at":"2015-07-08T23:01:56Z","pull_request":{"url":"https://api.github.com/repos/balderdashy/waterline/pulls/1076","html_url":"https://github.com/balderdashy/waterline/pull/1076","diff_url":"https://github.com/balderdashy/waterline/pull/1076.diff","patch_url":"https://github.com/balderdashy/waterline/pull/1076.patch"},"body":"Calling Collection.destroy({id: []}) destroys *all* documents. [Functionality exists in normalize that returns false if there's an empty array](https://github.com/balderdashy/waterline/blob/317cdf0173990face8afe67b336bc6e6d0fe5630/lib/waterline/utils/normalize.js#L191), but false is OR'd with {}, [resulting in a {} being passed to the sails-mongo adapter](https://github.com/balderdashy/sails-mongo/blob/master/lib/adapter.js#L367), which deletes everything.\r\n\r\nThis PR just applies [what is already implemented for find()](https://github.com/balderdashy/waterline/blob/master/lib/waterline/query/finders/basic.js#L222).\r\n\r\nWe found this out the hard way. :("},"comment":{"url":"https://api.github.com/repos/balderdashy/waterline/issues/comments/119754724","html_url":"https://github.com/balderdashy/waterline/pull/1076#issuecomment-119754724","issue_url":"https://api.github.com/repos/balderdashy/waterline/issues/1076","id":119754724,"user":{"login":"dmarcelino","id":1280446,"avatar_url":"https://avatars.githubusercontent.com/u/1280446?v=3","gravatar_id":"","url":"https://api.github.com/users/dmarcelino","html_url":"https://github.com/dmarcelino","followers_url":"https://api.github.com/users/dmarcelino/followers","following_url":"https://api.github.com/users/dmarcelino/following{/other_user}","gists_url":"https://api.github.com/users/dmarcelino/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarcelino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarcelino/subscriptions","organizations_url":"https://api.github.com/users/dmarcelino/orgs","repos_url":"https://api.github.com/users/dmarcelino/repos","events_url":"https://api.github.com/users/dmarcelino/events{/privacy}","received_events_url":"https://api.github.com/users/dmarcelino/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T23:02:32Z","updated_at":"2015-07-08T23:02:32Z","body":"Thanks @slester!"}}