In Rails, you can include dependent objects in your JSON. I donโt know the backend you use, but that would save you on two trips:
{ att1: val, col1: [{obj1: val}, {...}], col2: [{...}] }
Otherwise, redefine the initialization of the Model to create and select two new dependent collections.
source share