neumino / thinky

JavaScript ORM for RethinkDB
http://justonepixel.com/thinky/
Other
1.12k stars 128 forks source link

using joins #74

Closed colprog closed 10 years ago

colprog commented 10 years ago

I was trying to do some log processing, so document structure varies. There seems to be some problem when joining. I am doing something like this: var stream1 = Log.between() var stream2 = Log.between() stream1.innerJoin(stream2, func).run()

since stream2 is not a Term. above code throws an exception constructing query. I tried stream1.innerJoin(stream2._query).run(), but that produces wrong result.

Am I missing something?

neumino commented 10 years ago

stream1.innerJoin(stream2._query, func) should work.

I can take a look at that tonight or tomorrow when I'll have access to a computer

neumino commented 10 years ago

Seems to work fine for me. I added a test just in case in 1.1.1 https://github.com/neumino/thinky/blob/master/test/advanced.js#L2556