Problem :
I have a very complex json which have several integer values which are beyond 8 Bytes (c_time, p_time) and some which are smaller(id from the below example)
Example structure:
{
"c_time": 18446744062065078000,
"p_time": 18446744062065078000,
"id" : 122,
"name" : "example",
... : ...
simple json structure
}
When i want to insert this json into Mongo, iam facing the following error.
Exception MongoDB can only handle up to 8-byte ints
What I Tried:
To rectify this i have 2 options, one way is to parse through the json and remove all such large ints using del c_time
. But this obviously has problem which is iam losing valuable info.
Secondly i want to convert these large ints to stings.I parse through the json and tried converting them to strings, but due to complex structure and depth of json its difficult to convert all of them to string.
Is there any simple and effective way to convert all the long ints inside the given json into stings without major penalty of system.