{"id":3262,"date":"2016-03-07T01:58:28","date_gmt":"2016-03-07T01:58:28","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=3262"},"modified":"2016-03-07T01:58:28","modified_gmt":"2016-03-07T01:58:28","slug":"3262-2","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/3262-2\/","title":{"rendered":"RethinkDB: Ends With Example"},"content":{"rendered":"<p>RethinkDB filters work on regular expressions, so you can simply match on the end of the line to filter a result:<\/p>\n<pre lang=\"javascript\">\nr.db('test')\n .table('users')\n  .filter( (doc) => doc('user_name').match(\"ieling$\") )\n<\/pre>\n<p>If you want this to be case-insensitive, do the following:<\/p>\n<pre lang=\"javascript\">\nr.db('test')\n .table('users')\n  .filter( (doc) => doc('user_name').downcase().match(\"ieling$\") )\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>RethinkDB filters work on regular expressions, so you can simply match on the end of the line to filter a result: r.db(&#8216;test&#8217;) .table(&#8216;users&#8217;) .filter( (doc) => doc(&#8216;user_name&#8217;).match(&#8220;ieling$&#8221;) ) If you want this to be case-insensitive, do the following: r.db(&#8216;test&#8217;) .table(&#8216;users&#8217;) .filter( (doc) => doc(&#8216;user_name&#8217;).downcase().match(&#8220;ieling$&#8221;) )<\/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":[160,302,462,466,523],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3262"}],"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=3262"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3262\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=3262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=3262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=3262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}