{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/159","labels_url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/159/comments","events_url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/159/events","html_url":"https://github.com/balderdashy/sails-postgresql/issues/159","id":73559413,"number":159,"title":"Filter criteria checking for NOT NULL cannot be added before other criteria","user":{"login":"eriklindgren","id":80689,"avatar_url":"https://avatars.githubusercontent.com/u/80689?v=3","gravatar_id":"","url":"https://api.github.com/users/eriklindgren","html_url":"https://github.com/eriklindgren","followers_url":"https://api.github.com/users/eriklindgren/followers","following_url":"https://api.github.com/users/eriklindgren/following{/other_user}","gists_url":"https://api.github.com/users/eriklindgren/gists{/gist_id}","starred_url":"https://api.github.com/users/eriklindgren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eriklindgren/subscriptions","organizations_url":"https://api.github.com/users/eriklindgren/orgs","repos_url":"https://api.github.com/users/eriklindgren/repos","events_url":"https://api.github.com/users/eriklindgren/events{/privacy}","received_events_url":"https://api.github.com/users/eriklindgren/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/balderdashy/sails-postgresql/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/balderdashy/sails-postgresql/labels/needs%20review","name":"needs review","color":"5319e7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-06T08:40:11Z","updated_at":"2015-09-23T06:21:54Z","closed_at":"2015-09-23T06:21:53Z","body":"**Example**\r\n\r\n`.find({ paid_at: { '!': null }, owner: 1 })`\r\n\r\nis translated to this database query:\r\n`WHERE \"paid_at\" IS NOT NULL  AND \"owner\" = $2`\r\n\r\nwhich results in `ERROR:  could not determine data type of parameter $1` because the NOT NULL criteria takes the place of the first parameter in the query.\r\n\r\nA workaround is to always add NOT NULL criteria last."},"comment":{"url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/comments/142506640","html_url":"https://github.com/balderdashy/sails-postgresql/issues/159#issuecomment-142506640","issue_url":"https://api.github.com/repos/balderdashy/sails-postgresql/issues/159","id":142506640,"user":{"login":"sailsbot","id":14700466,"avatar_url":"https://avatars.githubusercontent.com/u/14700466?v=3","gravatar_id":"","url":"https://api.github.com/users/sailsbot","html_url":"https://github.com/sailsbot","followers_url":"https://api.github.com/users/sailsbot/followers","following_url":"https://api.github.com/users/sailsbot/following{/other_user}","gists_url":"https://api.github.com/users/sailsbot/gists{/gist_id}","starred_url":"https://api.github.com/users/sailsbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sailsbot/subscriptions","organizations_url":"https://api.github.com/users/sailsbot/orgs","repos_url":"https://api.github.com/users/sailsbot/repos","events_url":"https://api.github.com/users/sailsbot/events{/privacy}","received_events_url":"https://api.github.com/users/sailsbot/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T06:21:53Z","updated_at":"2015-09-23T06:21:53Z","body":"Thanks for posting, @eriklindgren.  I'm a repo bot-- nice to meet you!\n\nIt has been 30 days since there have been any updates or new comments on this page.  If this issue has been resolved, feel free to disregard the rest of this message.  On the other hand, if you are still waiting on a patch, please:\n\n  + review our [contribution guide](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md) to make sure this submission meets our criteria (only _verified bugs_ with documented features, please;  no questions, commentary, or bug reports about undocumented features or unofficial plugins)\n  + create a new issue with the latest information, including updated version details with error messages, failing tests, and a link back to [the original issue]().  This allows GitHub to automatically create a back-reference for future visitors arriving from search engines.\n\nThanks so much for your help!"}}