Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 869567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:19:41+00:00 2026-05-15T10:19:41+00:00

EDIT: it turns out it’s NOT a problem.. pfew! phpMOadmin is not able to

  • 0

EDIT: it turns out it’s NOT a problem.. pfew! phpMOadmin is not able to display the bigint (probably server apache settings i didn’t care).. not mongoDB is unable to save… u.kodingen.com/1fMs5Z i requested from CLI, and it comes back just fine! sorry mongodb.


when i insert tweet to mongodb, it’s id e.g. 16906830606 becomes -274549723

our servers are 64bits, I use php mongo driver.

this is the full insert code,

$content = file_get_contents("http://search.twitter.com/search.json?q=worldcup");
$decoded = json_decode($content,true);
  $c = new Mongo("mongodb://x:pass@mng.vps.kodingen.com:27017");
  foreach($decoded['results'] as $tweet) 
  {  
    $tweet['_id'] = $tweet['id'];
    $c->db->tweets->insert($tweet);
  }

This is how it saves: http://u.kodingen.com/1fKw6E

If I force it as String,

$tweet['_id'] = "" . $tweet['id'];

then it’s correct: http://u.kodingen.com/1fKy8g

I want to know why this happens, and what else I should be worried about MongoDB while you are at it 🙂 just starting out here..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:19:42+00:00Added an answer on May 15, 2026 at 10:19 am

    The _id field, that usually stores an ObjectID, is 12 bytes. A 64-bit integer is 8 bytes. Obviously it has to be converted in some way. As it seems, not in a very good way.

    The fact that the timestamp and counter fields must be stored big endian could also be in play.

    I would consider not using the tweet id as ObjectID since you can’t be certain that they don’t add a couple of digits to it tomorrow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.