OverflowError: MongoDB can only handle up to 8-byte ints
I’m using a find() to get data from a collection then I’m looping and inserting it into an api call and pushing the values in the response to a new collection.
I works but then I get those error when it reaches a larger number of records.
Thanks. So it looks like it’s due to the letter ‘E’ being parsed and returned as a scientific notation, e+.
So a value of 5E62 is coming in as an exponential number, 5e+62. I took the json response and converted it to a string and did a replace(“e”,“E”), which it seemed to work. But then when I converted it back to json it reverted it back to the exponential number. I’m using ast.literal_eval(string) to convert back to json.
Is there a way to keep the “E” and not have it convert back when converting back to json?
Could you elaborate more on what you’re trying to insert into MongoDB i.e. example of value ?
Also, it would be useful to know what your intention of usage of the field’s value. i.e. are you going to run further computation/calculation on the value ?