{"action":"closed","issue":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3851","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3851/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3851/comments","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/3851/events","html_url":"https://github.com/rethinkdb/rethinkdb/issues/3851","id":59302910,"number":3851,"title":"Keep \"SELECTION\" on \"SELECTION<STREAM>\"s queried through hasFields","user":{"login":"thejsj","id":1981198,"avatar_url":"https://avatars.githubusercontent.com/u/1981198?v=3","gravatar_id":"","url":"https://api.github.com/users/thejsj","html_url":"https://github.com/thejsj","followers_url":"https://api.github.com/users/thejsj/followers","following_url":"https://api.github.com/users/thejsj/following{/other_user}","gists_url":"https://api.github.com/users/thejsj/gists{/gist_id}","starred_url":"https://api.github.com/users/thejsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejsj/subscriptions","organizations_url":"https://api.github.com/users/thejsj/orgs","repos_url":"https://api.github.com/users/thejsj/repos","events_url":"https://api.github.com/users/thejsj/events{/privacy}","received_events_url":"https://api.github.com/users/thejsj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels/cp:reql","name":"cp:reql","color":"02d7e1"},{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels/tp:bug","name":"tp:bug","color":"e102d8"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/96","html_url":"https://github.com/rethinkdb/rethinkdb/milestones/2.1-polish","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/96/labels","id":1006508,"number":96,"title":"2.1-polish","description":"","creator":{"login":"timmaxw","id":316661,"avatar_url":"https://avatars.githubusercontent.com/u/316661?v=3","gravatar_id":"","url":"https://api.github.com/users/timmaxw","html_url":"https://github.com/timmaxw","followers_url":"https://api.github.com/users/timmaxw/followers","following_url":"https://api.github.com/users/timmaxw/following{/other_user}","gists_url":"https://api.github.com/users/timmaxw/gists{/gist_id}","starred_url":"https://api.github.com/users/timmaxw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmaxw/subscriptions","organizations_url":"https://api.github.com/users/timmaxw/orgs","repos_url":"https://api.github.com/users/timmaxw/repos","events_url":"https://api.github.com/users/timmaxw/events{/privacy}","received_events_url":"https://api.github.com/users/timmaxw/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":1,"state":"open","created_at":"2015-03-04T21:09:56Z","updated_at":"2015-05-13T21:32:14Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-02-27T22:18:35Z","updated_at":"2015-05-13T21:32:14Z","closed_at":"2015-05-13T21:32:14Z","body":"The [`.hasFields`](http://rethinkdb.com/api/javascript/has_fields/) method converts a \"SELECTION<STREAM>\" into a \"STREAM\". `.filter`, on the other hand, keeps the original reference to the selection. The functionality between these seems similar enough that I would have expected `.hasFields` to keep the reference to the source rows through the \"SELECTION\". \r\n\r\nIs it possible for `.hasFields` to return a \"SELECTION<STREAM>\" when provided a \"SELECTION<STREAM>\", instead of returning a \"STREAM\"? All this is also true for \"SELECTION<ARRAY>\".\r\n\r\nExample Queries:\r\n\r\n```\r\nr.db('caltrain').table('trains')\r\n .between(300, 400, {'index': 'number'})\r\n .orderBy({'index': 'number'})\r\n .filter({'direction': 'north'})\r\n .typeOf() // \"SELECTION<STREAM>\"\r\n```\r\n\r\n```\r\nr.db('caltrain').table('trains')\r\n .between(300, 400, {'index': 'number'})\r\n .orderBy({'index': 'number'})\r\n .filter({'direction': 'north'})\r\n .hasFields({'stations': true})\r\n .typeOf() // \"STREAM\"\r\n```"}}