[SOLVED] Error: A duplicate value for a field with unique values was provided

Hello, I get this error trying, it saves the first user, then anyone is saved. Only the EthAddress, not name and surename in the form.

2022-02-08T21:10:54.034Z - Error: A duplicate value for a field with unique values was provided
at /moralis-server/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js:506:15
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-02-08T21:01:42.663Z - Error: A duplicate value for a field with unique values was provided
at /moralis-server/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js:506:15
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-02-08T21:01:14.172Z - Error: A duplicate value for a field with unique values was provided
at /moralis-server/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js:506:15
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-02-08T20:46:11.291Z - Error: A duplicate value for a field with unique values was provided
at /moralis-server/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js:506:15
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-02-08T20:46:03.832Z - Error: A duplicate value for a field with unique values was provided
at /moralis-server/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js:506:15
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-02-08T20:42:34.991Z - Error: A duplicate value for a field with unique values was provided
at /moralis-server/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js:506:15
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-02-08T20:41:47.518Z - Error: A duplicate value for a field with unique values was provided
at /moralis-server/lib/Adapters/Storage/Mongo/MongoStorageAdapter.js:506:15
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)

what are the fields that you add for the users?

Untitled

what you wanted to add to db for those users where it didn’t work?

you could also point to the code that add the user, you can also see here how to format code on forum:

Surename | Student ID | Wallet
Untitled

Problem solved, thanks

1 Like

What was the solution? It will help the community if someone faces the same error.

1 Like

I am noob and I put the incorrect code on the incorrect folder

2 Likes