Open Anurag13975 opened 7 months ago
there is a minor code issue of function depreciation that might cause an issue in prodcution.
In your code , there is a file named seedRoutes.js. in that file there is a line of code written as below: await Product.remove({});
await Product.remove({});
In new mongoose versions, document.remove() is deprecated. Replace remove() with deleteOne() or deleteMany().
here we should use deleteMany() function. Thus change this line to the new one
await ProductCollection.deleteMany({});
there is a minor code issue of function depreciation that might cause an issue in prodcution.
In your code , there is a file named seedRoutes.js. in that file there is a line of code written as below:
await Product.remove({});
In new mongoose versions, document.remove() is deprecated. Replace remove() with deleteOne() or deleteMany().
here we should use deleteMany() function. Thus change this line to the new one
await ProductCollection.deleteMany({});