Open
Description
Link to reproduction
No response
Describe the Bug
The error message for unique field values is not working on Document DB. The keyValue variable is not present within the error object and so the generic error "something went wrong" is shown in production:
When connected to MongoDB:
ok: 0,
code: 11000,
codeName: 'DuplicateKey',
keyPattern: { slug: 1 },
keyValue: { slug: 'test' },
[Symbol(errorLabels)]: Set(0) {}
When connected to DocumentDB:
ok: 0,
operationTime: new Timestamp({ t: 1702377946, i: 1 }),
code: 11000,
[Symbol(errorLabels)]: Set(0) {}
To Reproduce
- Run PayloadCMS 2.3.1 with DocumentDB
- Create a unique field
- Try to add two items with the same field value
Payload Version
2.3.1
Adapters and Plugins
db-mongodb