3 ms·
RethinkDB has joins and I found its grouping to be straightforward and super powerful. Selecting distinct values is as simple as putting .distinct() at the end
by dkersten 10y ago
RethinkDB has joins and I found its grouping to be straightforward and super powerful. Selecting distinct values is as simple as putting .distinct() at the end of your ReQL. While it doesn't have foreign keys, any value can act as one as long as it holds a tables primary key (or other indexed fields), in which case you can do db.table('other_table').get(primary_key_val) (or getAll(foregin_key_val, {index: 'my_index'}) if not the PK, but otherwise indexed).
Granted, it won't validate that the keys exist, however (since its schemaless at the DB level), so nothing will prevent you from inserting a document with foreign keys that are invalid, but from a querying point of view, foreign keys are easy. Would be nice if you could set insert/update-checked constraints though.
- cyberferret 10y agoUseful cheat sheet. I've bookmarked for later study and research. Thanks.