{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/646","labels_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/646/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/646/comments","events_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/646/events","html_url":"https://github.com/strongloop/loopback-datasource-juggler/issues/646","id":90763909,"number":646,"title":"Filter where or condition is not working","user":{"login":"f0ysal","id":1332990,"avatar_url":"https://avatars.githubusercontent.com/u/1332990?v=3","gravatar_id":"","url":"https://api.github.com/users/f0ysal","html_url":"https://github.com/f0ysal","followers_url":"https://api.github.com/users/f0ysal/followers","following_url":"https://api.github.com/users/f0ysal/following{/other_user}","gists_url":"https://api.github.com/users/f0ysal/gists{/gist_id}","starred_url":"https://api.github.com/users/f0ysal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f0ysal/subscriptions","organizations_url":"https://api.github.com/users/f0ysal/orgs","repos_url":"https://api.github.com/users/f0ysal/repos","events_url":"https://api.github.com/users/f0ysal/events{/privacy}","received_events_url":"https://api.github.com/users/f0ysal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-24T19:29:58Z","updated_at":"2015-06-25T05:04:57Z","closed_at":null,"body":"@bajtos @raymondfeng \r\nThe Where Filter or condition is not working as expected\r\n\r\n```\r\nwhere: {\r\n                    startDate: {lte: Date.now()},\r\n                    or: [{endDate: null}, {signedDate: null}],\r\n                    and: [\r\n                        {\r\n                            endDate: {gt: Date.now()},\r\n                        }\r\n                    ]\r\n                }\r\n```\r\nWhich is generating SQL like this \r\n\r\n```\r\nWHERE [StartDate] <= '2015-06-24T18:38:06.866' **AND** ([EndDate] IS NULL) OR ([SignedDate] IS NULL) AND ([EndDate] > '2015-06-24T18:38:06.866' AND [DiscontStaffId] > 0) \r\n```\r\n\r\nOr is converting into AND? or there is different syntax for SQL like\r\n```\r\nWHERE [StartDate] <= '2015-06-24T18:38:06.866'  OR [EndDate] IS NULL\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/comments/115107084","html_url":"https://github.com/strongloop/loopback-datasource-juggler/issues/646#issuecomment-115107084","issue_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/646","id":115107084,"user":{"login":"f0ysal","id":1332990,"avatar_url":"https://avatars.githubusercontent.com/u/1332990?v=3","gravatar_id":"","url":"https://api.github.com/users/f0ysal","html_url":"https://github.com/f0ysal","followers_url":"https://api.github.com/users/f0ysal/followers","following_url":"https://api.github.com/users/f0ysal/following{/other_user}","gists_url":"https://api.github.com/users/f0ysal/gists{/gist_id}","starred_url":"https://api.github.com/users/f0ysal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f0ysal/subscriptions","organizations_url":"https://api.github.com/users/f0ysal/orgs","repos_url":"https://api.github.com/users/f0ysal/repos","events_url":"https://api.github.com/users/f0ysal/events{/privacy}","received_events_url":"https://api.github.com/users/f0ysal/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T05:04:56Z","updated_at":"2015-06-25T05:04:56Z","body":"Sorry I couldn't pick your answer. I tried to put and inside or but throwing error.\r\n\r\n```\r\nwhere: {\r\n                    mType: 'I',\r\n                    startDate: {lte: Date.now()},\r\n                    cId: 1,\r\n                    or: [*\r\n                        {\r\n                            endDate: {gt: Date.now()},\r\n                            dId: {gt: 0}\r\n                        },\r\n                        {endDate: null},\r\n                        {signedDate: null}\r\n                    *]\r\n                }\r\n```\r\n\r\nHow to put and extra parenthesis in the *"}}