Handle dependencies when inserting into a collection in a sustainable way

I have a series of collections which rely on each other. For example, my Student collection might have a relationship with Classes, which looks like this:

{ _id: "someid", name: "Bruce Wayne", classes: [ "classid1", "classid2" ] }

I would like to queue a number of these jobs to be completed. For example:

Ideally, what I'd like is some kind of method call like this:

seedCollection(Students, { dependencies: [Classes] });

Is there an easy and reliable way to insert into a series of collections in a specific order with Meteor?

Category:javascript Views:1 Time:2017-11-01

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.122 (s). 11 q(s)