{"action":"created","issue":{"url":"https://api.github.com/repos/codemix/oriento/issues/291","labels_url":"https://api.github.com/repos/codemix/oriento/issues/291/labels{/name}","comments_url":"https://api.github.com/repos/codemix/oriento/issues/291/comments","events_url":"https://api.github.com/repos/codemix/oriento/issues/291/events","html_url":"https://github.com/codemix/oriento/issues/291","id":64484357,"number":291,"title":"Issue with multiple fields for OrderBy-clause in query builder","user":{"login":"mamobyz","id":8832554,"avatar_url":"https://avatars.githubusercontent.com/u/8832554?v=3","gravatar_id":"","url":"https://api.github.com/users/mamobyz","html_url":"https://github.com/mamobyz","followers_url":"https://api.github.com/users/mamobyz/followers","following_url":"https://api.github.com/users/mamobyz/following{/other_user}","gists_url":"https://api.github.com/users/mamobyz/gists{/gist_id}","starred_url":"https://api.github.com/users/mamobyz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mamobyz/subscriptions","organizations_url":"https://api.github.com/users/mamobyz/orgs","repos_url":"https://api.github.com/users/mamobyz/repos","events_url":"https://api.github.com/users/mamobyz/events{/privacy}","received_events_url":"https://api.github.com/users/mamobyz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-26T09:54:30Z","updated_at":"2015-06-19T09:07:28Z","closed_at":null,"body":"The statement.order() is supposed to work with \r\n- a string argument, e.g. order('age desc')\r\n- multiple string arguments, e.g. order('age asc', 'salary desc')\r\n- an array of strings, e.g order(['age asc', 'salary desc'])\r\n- an object with keys for the fields to be ordered by, and 'ASC' or 'DESC' as values\r\nis this correct?\r\n\r\nWhen using the 2nd and third variant, if some of strings contain whitespaces, the resulted orderBy-clause is wrongly parenthesized, such that\r\n```\r\nORDER BY (age asc), (salary desc)\r\n```\r\nwhich OrientDB then does not cope with.\r\nBesides, I doubt that parentheses are rquired at all!\r\nYou can easily comprehend the issue in statement-test.js with the following test:\r\n```\r\nit('orders multiple fields', function() {\r\n  this.statement.select().from('XYZ').order('field1 desc', 'field2');\r\n  this.statement.toString().should.equal('SELECT * FROM XYZ ORDER BY field1 desc, field2');\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/codemix/oriento/issues/comments/113439383","html_url":"https://github.com/codemix/oriento/issues/291#issuecomment-113439383","issue_url":"https://api.github.com/repos/codemix/oriento/issues/291","id":113439383,"user":{"login":"phpnode","id":363611,"avatar_url":"https://avatars.githubusercontent.com/u/363611?v=3","gravatar_id":"","url":"https://api.github.com/users/phpnode","html_url":"https://github.com/phpnode","followers_url":"https://api.github.com/users/phpnode/followers","following_url":"https://api.github.com/users/phpnode/following{/other_user}","gists_url":"https://api.github.com/users/phpnode/gists{/gist_id}","starred_url":"https://api.github.com/users/phpnode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpnode/subscriptions","organizations_url":"https://api.github.com/users/phpnode/orgs","repos_url":"https://api.github.com/users/phpnode/repos","events_url":"https://api.github.com/users/phpnode/events{/privacy}","received_events_url":"https://api.github.com/users/phpnode/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T09:07:28Z","updated_at":"2015-06-19T09:07:28Z","body":"This issue was moved to orientechnologies/orientjs#18"}}