Mongodb uses BSON format to store data on the disk. BSON defines different data types, including signed int64 for storing big integers.
Let's try to save document with big ID (887190505588098573), that fits in signed int64 range (its absolute value is less than 2^63)
> db.query.insert({_id: 887190505588098573, 'q': 'zzz'})
> db.query.find({_id: 887190505588098573})
{ "_id" : 887190505588098600, "q" : "zzz" }
Well, we got response with document ID that differs from the ID we requested.
What am I missing?