Mongoose adding incorrect value in UpdateOne

Its probably because the number of the discordID is bigger then the ‘Number.MAX_SAFE_INTEGER’, which means that javascript can not represent the exact number. See more information here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER

You can solve the problem by using BigInt. See details here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top