Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

How to 'one-to-many'

What is the best way to handle a one-to-many relationship. Do I store the _id's in an array and get the "many" dataset in a separate service call or is there a way to get everything in one go like using the "include" parameter in a request when wanting to include a Pointer reverence to another collection?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to 'one-to-many'

Hello! If you store your data in two tables - there is no way to get information through one request to DB. You should send two requests or store data in one table.

Dupdroid
Posts: 0
Joined: Sat Mar 30, 2013 9:07 pm

How to 'one-to-many'

Thank you Marina, I guess I have to rethink my db structure then.

Return to “Issues”