import { ProductsCollection } from 'meteor/moreplease:common';

const productIndexes = [
  { productId: 1 },
  { variationId: 1 },
  { storeId: 1 },
];

productIndexes.forEach((index) => {
  ProductsCollection.rawCollection().createIndex(index);
});

import { Meteor } from 'meteor/meteor';
import { ProductsCollection } from 'meteor/moreplease:common';

const productIndexes = [
  { productId: 1 },
  { variationId: 1 },
  { storeId: 1 },
];

Meteor.startup(() => {
  productIndexes.forEach((index) => {
    ProductsCollection.rawCollection().createIndex(index);
  });
});

Move index creation to startup
Move index creation to startup
