{"id":2427,"date":"2015-07-13T01:42:58","date_gmt":"2015-07-13T01:42:58","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=2427"},"modified":"2015-07-13T01:42:58","modified_gmt":"2015-07-13T01:42:58","slug":"rethinkdb-python-in-list-example","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/rethinkdb-python-in-list-example\/","title":{"rendered":"RethinkDB Python In-list example"},"content":{"rendered":"<p>Connect to the database:<\/p>\n<pre lang=\"python\">\nimport rethinkdb as r\nr.connect(\"127.0.0.1\", 28015).repl()\ndb = r.db(\"search\")\n<\/pre>\n<p>Filter using match:<\/p>\n<pre lang=\"python\">\ntable.filter(lambda r: r[\"rank\"] in (2,3,4)).count().run()\n<\/pre>\n<p>Note that unlike SQL, the column headers are case sensitive. It appears that the regular expression must match the entire string.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Connect to the database: import rethinkdb as r r.connect(&#8220;127.0.0.1&#8221;, 28015).repl() db = r.db(&#8220;search&#8221;) Filter using match: table.filter(lambda r: r[&#8220;rank&#8221;] in (2,3,4)).count().run() Note that unlike SQL, the column headers are case sensitive. It appears that the regular expression must match the entire string.<\/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":[157,160,447,462,466,523],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/2427"}],"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=2427"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/2427\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=2427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=2427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=2427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}