{"action":"created","issue":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/878","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/878/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/878/comments","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/878/events","html_url":"https://github.com/rethinkdb/rethinkdb/issues/878","id":14604059,"number":878,"title":"Proposal: stream operations on objects","user":{"login":"mlucy","id":1777134,"avatar_url":"https://avatars.githubusercontent.com/u/1777134?v=3","gravatar_id":"","url":"https://api.github.com/users/mlucy","html_url":"https://github.com/mlucy","followers_url":"https://api.github.com/users/mlucy/followers","following_url":"https://api.github.com/users/mlucy/following{/other_user}","gists_url":"https://api.github.com/users/mlucy/gists{/gist_id}","starred_url":"https://api.github.com/users/mlucy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlucy/subscriptions","organizations_url":"https://api.github.com/users/mlucy/orgs","repos_url":"https://api.github.com/users/mlucy/repos","events_url":"https://api.github.com/users/mlucy/events{/privacy}","received_events_url":"https://api.github.com/users/mlucy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels/tp:ReQL_proposal","name":"tp:ReQL_proposal","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"mlucy","id":1777134,"avatar_url":"https://avatars.githubusercontent.com/u/1777134?v=3","gravatar_id":"","url":"https://api.github.com/users/mlucy","html_url":"https://github.com/mlucy","followers_url":"https://api.github.com/users/mlucy/followers","following_url":"https://api.github.com/users/mlucy/following{/other_user}","gists_url":"https://api.github.com/users/mlucy/gists{/gist_id}","starred_url":"https://api.github.com/users/mlucy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlucy/subscriptions","organizations_url":"https://api.github.com/users/mlucy/orgs","repos_url":"https://api.github.com/users/mlucy/repos","events_url":"https://api.github.com/users/mlucy/events{/privacy}","received_events_url":"https://api.github.com/users/mlucy/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/2","html_url":"https://github.com/rethinkdb/rethinkdb/milestones/backlog","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/2/labels","id":211054,"number":2,"title":"backlog","description":"Issues in this milestone are not an immediate priority, and will be periodically revisited. When we decide to work on an issue in backlog, we'll move it to next.","creator":{"login":"coffeemug","id":48436,"avatar_url":"https://avatars.githubusercontent.com/u/48436?v=3","gravatar_id":"","url":"https://api.github.com/users/coffeemug","html_url":"https://github.com/coffeemug","followers_url":"https://api.github.com/users/coffeemug/followers","following_url":"https://api.github.com/users/coffeemug/following{/other_user}","gists_url":"https://api.github.com/users/coffeemug/gists{/gist_id}","starred_url":"https://api.github.com/users/coffeemug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coffeemug/subscriptions","organizations_url":"https://api.github.com/users/coffeemug/orgs","repos_url":"https://api.github.com/users/coffeemug/repos","events_url":"https://api.github.com/users/coffeemug/events{/privacy}","received_events_url":"https://api.github.com/users/coffeemug/received_events","type":"User","site_admin":false},"open_issues":551,"closed_issues":0,"state":"open","created_at":"2012-11-11T14:16:11Z","updated_at":"2015-11-10T02:01:40Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2013-05-22T04:49:51Z","updated_at":"2015-11-13T22:47:35Z","closed_at":null,"body":"We define `map`, `filter`, etc. on objects where the function passed to them takes another term.  For example:\r\n```ruby\r\n> r({:a => 1, :b => 2, :c => 3}).map {|k,v| r.branch(k.eq('c'), 100, v*v)}\r\n{:a => 1, :b => 4, :c => 100}\r\n> r({:a => 1, :b => 2, :c => 3}).filter {|k,v| k.eq('c').or(v.eq(2))}\r\n{:b => 2, :c => 3}\r\n```"},"comment":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/comments/156580801","html_url":"https://github.com/rethinkdb/rethinkdb/issues/878#issuecomment-156580801","issue_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/878","id":156580801,"user":{"login":"marshall007","id":877936,"avatar_url":"https://avatars.githubusercontent.com/u/877936?v=3","gravatar_id":"","url":"https://api.github.com/users/marshall007","html_url":"https://github.com/marshall007","followers_url":"https://api.github.com/users/marshall007/followers","following_url":"https://api.github.com/users/marshall007/following{/other_user}","gists_url":"https://api.github.com/users/marshall007/gists{/gist_id}","starred_url":"https://api.github.com/users/marshall007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marshall007/subscriptions","organizations_url":"https://api.github.com/users/marshall007/orgs","repos_url":"https://api.github.com/users/marshall007/repos","events_url":"https://api.github.com/users/marshall007/events{/privacy}","received_events_url":"https://api.github.com/users/marshall007/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T22:47:35Z","updated_at":"2015-11-13T22:47:35Z","body":"Bumping because I keep running into cases where this would be useful. Here's what I've been using as a workaround:\r\n\r\n```js\r\nr({ a: 1, b: 2, c: 3})\r\n  .coerceTo('array')\r\n  .map(function (item) {\r\n    var key = item(0),\r\n        value = item(1);    \r\n    // ...\r\n    return [ key, new_val ];\r\n  })\r\n  .coerceTo('object')\r\n```"}}