connected to db
C:\Users\HP\Desktop\amazona\backend\node_modules\mongodb\lib\bulk\common.js:910
callback(new MongoBulkWriteError({
^
MongoBulkWriteError: E11000 duplicate key error collection: test.products
index: category_1 dup key: { category: “Shirt” }
Bassir Changed status to publish October 10, 2022
hello there,
you have a unique key for category in the product model. remove it like this:
https://github.com/basir/mern-amazona/blob/master/backend/models/productModel.js#L21
then remove the db and restart the server and try again.
Bassir Answered question October 10, 2022