{"action":"created","issue":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5675","repository_url":"https://api.github.com/repos/rethinkdb/rethinkdb","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5675/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5675/comments","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5675/events","html_url":"https://github.com/rethinkdb/rethinkdb/issues/5675","id":148883608,"number":5675,"title":"implement rql get with optional index","user":{"login":"nojvek","id":1018196,"avatar_url":"https://avatars.githubusercontent.com/u/1018196?v=3","gravatar_id":"","url":"https://api.github.com/users/nojvek","html_url":"https://github.com/nojvek","followers_url":"https://api.github.com/users/nojvek/followers","following_url":"https://api.github.com/users/nojvek/following{/other_user}","gists_url":"https://api.github.com/users/nojvek/gists{/gist_id}","starred_url":"https://api.github.com/users/nojvek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nojvek/subscriptions","organizations_url":"https://api.github.com/users/nojvek/orgs","repos_url":"https://api.github.com/users/nojvek/repos","events_url":"https://api.github.com/users/nojvek/events{/privacy}","received_events_url":"https://api.github.com/users/nojvek/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":null,"milestone":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/41","html_url":"https://github.com/rethinkdb/rethinkdb/milestones/subsequent","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/41/labels","id":367201,"number":41,"title":"subsequent","description":"Issues in this milestone will be revisited after each major release during the planning stage for the major release after it. They will be moved to a specific release milestone if chosen for that release.","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":573,"closed_issues":2,"state":"open","created_at":"2013-06-30T07:32:52Z","updated_at":"2016-04-18T22:49:54Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-04-16T19:42:13Z","updated_at":"2016-04-18T22:50:45Z","closed_at":null,"body":"Having a secondary index of 1:1 mapping is very common, yet getAll returns an array, as a consumer I just want the first value if it exists or null. \r\n\r\nHaving table(x).get(z, {index:'z'}) would be very very useful. I end up writing workarounds for this in js, but having this built in rql would be really really awesome."},"comment":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/comments/211617687","html_url":"https://github.com/rethinkdb/rethinkdb/issues/5675#issuecomment-211617687","issue_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5675","id":211617687,"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},"created_at":"2016-04-18T22:50:45Z","updated_at":"2016-04-18T22:50:45Z","body":"Thanks for the proposal @nojvak!  What would you expect the behavior to be if you write `table.get(foo, index: 'bar')` and there are two entries in index `bar` with value `foo`?  Would you expect it to error, or pick a value and return it?"}}