From 043cedd0a1bba19715d3ee1f3af4451d34f441a6 Mon Sep 17 00:00:00 2001 From: Mikael Lirbank Date: Thu, 20 Sep 2018 11:37:07 -0700 Subject: [PATCH] Update documentation --- types/mongodb/index.d.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 4296da2084..06c7d7b3a4 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -209,17 +209,18 @@ export class MongoError extends Error { constructor(message: string); static create(options: Object): MongoError; code?: number; - // While not documented, the 'errmsg' prop is AFAIK the only way to find out - // which unique index caused a duplicate key error. When you have multiple - // unique indexes on a collection, knowing which index caused a duplicate - // key error enables you to send better (more precise) error messages to the - // client/user (eg. "Email address must be unique" instead of "Both email - // address and username must be unique") - which caters for a better (app) - // user experience. - // - // Details: - // https://github.com/Automattic/mongoose/issues/2129 (issue for mongoose, - // but the same applies for the mongodb native driver) + /** + * While not documented, the 'errmsg' prop is AFAIK the only way to find out + * which unique index caused a duplicate key error. When you have multiple + * unique indexes on a collection, knowing which index caused a duplicate + * key error enables you to send better (more precise) error messages to the + * client/user (eg. "Email address must be unique" instead of "Both email + * address and username must be unique") - which caters for a better (app) + * user experience. + * + * Details: https://github.com/Automattic/mongoose/issues/2129 (issue for + * mongoose, but the same applies for the native mongodb driver) + */ errmsg?: string; }