3 ms·
I think the latter approach is actually preferable in all cases in which you want to join the 2 (which is normally the whole point). The reason is that it makes
by jdoliner 14y ago
I think the latter approach is actually preferable in all cases in which you want to join the 2 (which is normally the whole point). The reason is that it makes it easy to use equijoin which won't work with arrays. So suppose I have table A and table B and table A-to-B describing their relationships. Table A-to-B has documents that look like:
{a_id: "foo", b_id: "bar"}
I can then say:
table("A-to-B").eq_join("a_id", table("A")).zip().eq_join("b_id", table("B")).zip()
And you'll get a document for each corresponding pair. If the ids are in an array then it's going to be a bit painful to write that query. (Although it can be done I believe).
A future feature will probably be to make eq_join work with arrays of foreign keys.
- alexpopescu 14y ago> A future feature will probably be to make eq_join work with arrays of foreign keys. Nice!!!