Hacker News new | ask | show | jobs
by atnnn 4088 days ago
The RethinkDB query language can be very expressive.

What you shudder to think of could be expressed as

    row('species').contains(function(s){ r.expr(['Saiyan', 'Human', 'Android']).contains(s) })
Or also as:

    row('species').setIntersection(['Saiyan', 'Human', 'Android']).isEmpty().not()
The succintness of ReQL depends on that of the host language. JavaScript's bulky syntax for functions and lack of operator overloading make queries a lot more cluttered.
1 comments

Untested, but also something like this should work:

    r.expr(['Saiyan', 'Human', 'Android']).contains(row('specias'))