{"id":3296,"date":"2016-03-07T03:35:37","date_gmt":"2016-03-07T03:35:37","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=3296"},"modified":"2016-03-07T03:35:37","modified_gmt":"2016-03-07T03:35:37","slug":"rethinkdb-expected-type-sequence-found-single_selection","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/rethinkdb-expected-type-sequence-found-single_selection\/","title":{"rendered":"RethinkDB: &#8220;Expected type SEQUENCE but found SINGLE_SELECTION&#8221;"},"content":{"rendered":"<p>If you write a query like this:<\/p>\n<pre lang=\"javascript\">\nr.db('test')\n .table('users')\n .get('first_name')\n .filter(\n     (x) => \n        r.db('test')\n         .table('users')\n         .pluck('id')\n         .contains(x(\"id\"))\n   )\n<\/pre>\n<p>You can get an error like so:<\/p>\n<pre>\ne: Expected type SEQUENCE but found SINGLE_SELECTION:\n<\/pre>\n<p>This is attempting to filter one set of rows from another.<\/p>\n<p>A simpler way to do this is to use a join:<\/p>\n<pre lang=\"javascript\">\nr.db('test')\n .table('users')\n .eqJoin(\n     'id',\n     r.table('users')\n   )\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you write a query like this: r.db(&#8216;test&#8217;) .table(&#8216;users&#8217;) .get(&#8216;first_name&#8217;) .filter( (x) => r.db(&#8216;test&#8217;) .table(&#8216;users&#8217;) .pluck(&#8216;id&#8217;) .contains(x(&#8220;id&#8221;)) ) You can get an error like so: e: Expected type SEQUENCE but found SINGLE_SELECTION: This is attempting to filter one set of rows from another. A simpler way to do this is to use a join: r.db(&#8216;test&#8217;) &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/rethinkdb-expected-type-sequence-found-single_selection\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;RethinkDB: &#8220;Expected type SEQUENCE but found SINGLE_SELECTION&#8221;&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[302,462,466,523],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3296"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=3296"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3296\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=3296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=3296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=3296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}