clarkie / dynogels

DynamoDB data mapper for node.js. Originally forked from https://github.com/ryanfitz/vogels
Other
490 stars 110 forks source link

Multiple Batch Get Items with different Tables.Handling table references #102

Closed iiitmahesh closed 6 years ago

iiitmahesh commented 7 years ago

Multiple Batch Get Items with different Tables.Handling table references ( I am new to this, please correct me if I am wrong)

I had a case here. => Table2 has reference attribute of primary key Table 1. => Table3 has reference attributes from primary keys Table1, Table2.

branches{name, location,......}, users{id, name,branchid.....}, orders{id, userid,branchid,..........}

I have a situation if hit order web service(API), I need to show both user data, branch data along order data.

(Is there any direct facility to get this using dynogels ??) To achieve my need, should I write multiple API calls or should I save duplicate in other tables???

clarkie commented 6 years ago

Hi @iiitmahesh, there's no functionality in dynogels to do this. In fact in dynamodb there isn't such a think as a foreign key.

You'll need to do this with multiple api calls as I don't see this as functionality that should be provided by dynogels.