rethinkdb / horizon

Horizon is a realtime, open-source backend for JavaScript apps.
MIT License
6.78k stars 350 forks source link

Relational joins `.eqJoin()` #308

Open ChrisCates opened 8 years ago

ChrisCates commented 8 years ago

Wondering if we could at minimum support .eqJoin(). I'm thinking of a cascading syntax for .find() and .findAll()

something like .find(table1).join(table1Id)

I think this tackles one to one, one to many and many to many associations :)

deontologician commented 8 years ago

This would be really cool, though I'd like to wait until changefeeds on eqJoins are added in RethinkDB 2.4. (see rethinkdb/rethinkdb#3997). Once they're in the server it'll be very fast in Horizon

daniel1943 commented 8 years ago

Is this still in plans? Any idea when rdb2.4 and related horizon goodies will be released :)?

Any good temporary solutions? Best I could come up with:

Watch data from 2 collections and let middleware re-combine data from both whenever 1 updates.

danielmewes commented 8 years ago

Unfortunately changefeeds on joins have been pushed into RethinkDB 2.5. We decided to implement changefeeds on reductions in RethinkDB 2.4 first instead. RethinkDB 2.5 is probably about 5-6 months away.