Last active
August 29, 2015 14:22
-
-
Save tlatsas/4f2de3e8c1a42d8daff1 to your computer and use it in GitHub Desktop.
RethinkDB notes (Data Explorer)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// filter entries with empty 'field1' | |
r.db('db_name') | |
.table('test') | |
.filter(function(search){ return search.hasFields('field1').not() }) | |
.count(); | |
// return only rows that have 'field1' presesent | |
r.db('db_name') | |
.table('test') | |
.hasFields('field1') | |
.count(); | |
// join two tables (test1 + test2) based on field equality (field1 is present on both tables) | |
r.db('db_name') | |
.table('test1') | |
.eqJoin('field1', r.db('db_name').table('test2'), {index: 'field1'}) | |
.zip() | |
.pluck('field1', 'other_interesting_fields') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment