@mongez/monpulse
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -337,3 +337,2 @@ "use strict"; | ||
try { | ||
console.log("Try", tries); | ||
// await this.getDatabase().startSessionContext(async ({ session }) => { | ||
@@ -346,5 +345,3 @@ // check for default values and merge it with the data | ||
await this.generateNextId(); | ||
console.log(this.id); | ||
} | ||
console.log("ID!", this.id); | ||
const now = new Date(); | ||
@@ -394,3 +391,4 @@ const createdAtColumn = this.createdAtColumn; | ||
error instanceof mongodb.MongoServerError && | ||
error.code === 11000 | ||
error.code === 11000 && | ||
tries < 2 | ||
) { | ||
@@ -397,0 +395,0 @@ const duplicateField = error.keyValue; |
@@ -338,3 +338,2 @@ import { | ||
try { | ||
console.log("Try", tries); | ||
// await this.getDatabase().startSessionContext(async ({ session }) => { | ||
@@ -347,5 +346,3 @@ // check for default values and merge it with the data | ||
await this.generateNextId(); | ||
console.log(this.id); | ||
} | ||
console.log("ID!", this.id); | ||
const now = new Date(); | ||
@@ -393,3 +390,7 @@ const createdAtColumn = this.createdAtColumn; | ||
// Handle duplicate key error | ||
if (error instanceof MongoServerError && error.code === 11000) { | ||
if ( | ||
error instanceof MongoServerError && | ||
error.code === 11000 && | ||
tries < 2 | ||
) { | ||
const duplicateField = error.keyValue; | ||
@@ -396,0 +397,0 @@ const errorMessage = `A user with the same ${ |
{ | ||
"name": "@mongez/monpulse", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Powerful Mongodb Database Manager for Node Js", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
464497
17660