Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
While setting my welcome channel ID to mongodb why my last two digit changes

When i am trying to set my welcome channel ID to MongoDB Why my channel last two digit chages to "00" for example 954226649841430572 --> (when i send to database it changes to) 954226649841430500

mongodb page

my code :

 await guild.updateOne(
          { guildID },
          { $set: { leavechannel: channelID } }
        );
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

In MongoDB large numbers can sometimes be cut due to the nature of storing large Ints. Instead of saving the value raw as a number, first use the .toString() method and store the value as a string. This will eliminate the issue of MongoDB cutting off large Ints and because JS is dynamically typed will have no effect on using the ID as a number once you fetch it from MongoDB.

Similar question answered here about Ints that are too large

Edit: In addition to the large Int issue, Discord.js will parse snowflakes into strings anyways.

From https://discord.com/developers/docs/reference#snowflakes There are some cases in which our API and Gateway may return IDs in an unexpected format. Internally, Discord stores IDs as integer snowflakes. When we serialize IDs to JSON, we transform bigints into strings. Given that all Discord IDs are snowflakes, you should always expect a string.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!