I would like to create dynamic remove
of dynamic import
in Methods
export const dynamicRemove = new ValidatedMethod({
name: 'dynamicRemove',
mixins: [CallPromiseMixin],
validate: null,
async run({collectionPath, selector}) {
const {default: Collection} = await import(collectionPath);
return Collection.remove(selector);
}
});
----------- Get error ----------------
collection.js:165 Uncaught Error: Expected to find a document already present for removed
at Object.update
And then I don’t us async
export const dynamicRemove = new ValidatedMethod({
name: 'dynamicRemove',
mixins: [CallPromiseMixin],
validate: null,
run({collectionPath, selector}) {
import(collectionPath).then(({default: Collection}) => {
Collection.remove(selector);
});
}
});
---------- Get error ---------
Exception in flushing DDP buffered writes: Error: Expected to find a document already present for removed
at Object.update (http://localhost:3000/packag
Please help me