I have a package that has the following directory structure.
products
├── README.md
├── collections.js
├── fixtures
│ ├── facts.json
│ └── products.json
├── package.js
├── publications.js
├── routes.js
└── seed.js
On startup, I want to get all the json in the fixtures
directory and perform an operation.
Meteor.startup(function () {
// insert static assets on startup.
EJSON.parse(Assets.getText('fixtures/products.json')).forEach(product => {
Products.upsert(product, { $set: product });
});
});
However, it never seems to be able to do this. Is there a proper way to manage this?