{"action":"closed","issue":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/593","labels_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/593/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/593/comments","events_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/593/events","html_url":"https://github.com/tgriesser/bookshelf/issues/593","id":55360755,"number":593,"title":"Simplify fetching collection without knex query() call?","user":{"login":"demisx","id":4452412,"avatar_url":"https://avatars.githubusercontent.com/u/4452412?v=3","gravatar_id":"","url":"https://api.github.com/users/demisx","html_url":"https://github.com/demisx","followers_url":"https://api.github.com/users/demisx/followers","following_url":"https://api.github.com/users/demisx/following{/other_user}","gists_url":"https://api.github.com/users/demisx/gists{/gist_id}","starred_url":"https://api.github.com/users/demisx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demisx/subscriptions","organizations_url":"https://api.github.com/users/demisx/orgs","repos_url":"https://api.github.com/users/demisx/repos","events_url":"https://api.github.com/users/demisx/events{/privacy}","received_events_url":"https://api.github.com/users/demisx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-24T06:26:27Z","updated_at":"2015-01-24T15:27:06Z","closed_at":"2015-01-24T15:27:06Z","body":"I currently have this fetch call on a collection:\r\n\r\n```js\r\nvar query = req.query || {};\r\n\r\nAds\r\n    .query({\r\n      where: {\r\n        classified_id: query.classId, section_id: query.secId, category_id: query.catId\r\n      }\r\n    })\r\n    .fetch({\r\n      columns:['ads.id', 'ads.title', 'ads.description', 'ads.price', 'ads.location']\r\n    })\r\n    .then(function(ads) {\r\n      res.json(ads);\r\n    });\r\n```\r\n\r\nthat produces this query:\r\n\r\n```sql\r\nselect \r\n  \"ads\".\"id\", \"ads\".\"title\", \"ads\".\"description\", \"ads\".\"price\", \"ads\".\"location\" from \"ads\" \r\nwhere \r\n  \"classified_id\" = $1 and \"section_id\" = $2 and \"category_id\" = $3\r\n```\r\n\r\nMy collection fetch seems over-engineered. Is there a way to simplify the call without tapping into knex `query()` method? "}}