matteodelabre / mongoose-beautiful-unique-validation

Plugin for Mongoose that turns duplicate errors into regular Mongoose validation errors
MIT License
117 stars 38 forks source link

Version 7.1.1 Doesn't work mongoose 6.0.9 && mongo version 4.2 #68

Open OguzBey opened 3 years ago

OguzBey commented 3 years ago

error to string

MongoServerError: E11000 duplicate key error collection: test_db.users index: email_1 dup key: { email: "deneme@deneme.com" } at /api/node_modules/mongodb/lib/operations/insert.js:51:33 at /api/node_modules/mongodb/lib/cmap/connection_pool.js:272:25 at handleOperationResult (/api/node_modules/mongodb/lib/sdam/server.js:363:9) at MessageStream.messageHandler (/api/node_modules/mongodb/lib/cmap/connection.js:479:9) at MessageStream.emit (events.js:314:20) at processIncomingData (/api/node_modules/mongodb/lib/cmap/message_stream.js:108:16) at MessageStream._write (/api/node_modules/mongodb/lib/cmap/message_stream.js:28:9) at writeOrBuffer (_stream_writable.js:352:12) at MessageStream.Writable.write (_stream_writable.js:303:10) at Socket.ondata (_stream_readable.js:714:22) { index: 0, code: 11000, keyPattern: { email: 1 }, keyValue: { email: 'deneme@deneme.com' } }

OguzBey commented 3 years ago

link pull req #69