js should have no restrictions on it, but the performance of the computer is limited. I actually tested it:
var obj={};
for(var i=0;i<80000000;i++){
obj[i]=i;
if(i%1000==0){
console.log(i);
}
}
My computer will crash when it reaches over 70 million. The more complex the keys and values stored in the object, the smaller the number that can be accommodated.
But in actual application, you definitely can’t do it like this!
Hundreds of thousands of properties. . . JSON itself does not have any restrictions on the number of attributes, but js processing may be very slow, or a single request may not be able to be accommodated through http transmission. . .
js should have no restrictions on it, but the performance of the computer is limited.
I actually tested it:
My computer will crash when it reaches over 70 million.
The more complex the keys and values stored in the object, the smaller the number that can be accommodated.
But in actual application, you definitely can’t do it like this!
... Then why do you use Json? It's hard to throw the data into the database and then use the backend to write a program to read the database. .
Hundreds of thousands of properties. . . JSON itself does not have any restrictions on the number of attributes, but js processing may be very slow, or a single request may not be able to be accommodated through http transmission. . .
The question is why do you put hundreds of thousands of attributes in a JSON. .