1602 / jugglingdb

Multi-database ORM for nodejs: redis, mongodb, mysql, sqlite3, postgresql, arango, in-memory...
http://1602.github.io/jugglingdb/
2.04k stars 241 forks source link

Does the include param / method support hasAndBelongsToMany relationships? #358

Closed mshick closed 10 years ago

mshick commented 10 years ago

I've been trying to load some objects with these relations via the include method and the .all() param, but no luck.

I can load them via the other approach, eg, instance.relation() but not with include.

anatoliychakkaev commented 10 years ago

Check this test to see how it should work: https://github.com/1602/jugglingdb/blob/master/test/relations.test.js#L215

On Wed, Jan 15, 2014 at 4:34 PM, Michael Shick notifications@github.comwrote:

I've been trying to load some objects with these relations via the include method and the .all() param, but no luck.

I can load them via the other approach, eg, instance.relation() but not with include.

— Reply to this email directly or view it on GitHubhttps://github.com/1602/jugglingdb/issues/358 .

mshick commented 10 years ago

Arg, I'm sorry I didn't get back sooner.

I did use the relations test to get up an running with relations broadly. However, what I'm talking about is more like what goes on in the includes test:

https://github.com/1602/jugglingdb/blob/master/test/include.test.js

Basically, it seems to me that relationships I define was hasAndBelongsToMany will not show up when using that syntax. I've tried tracing through the lib/include.js file, but haven't been able to get anywhere...