我正在构建一个包含多个地址的JSON。 我担心JSON大小可能会变得太大,并且在浏览器和JS解析期间会成为瓶颈。 由于可以看到,不同的键,即“ID”,“FirmName”,“Address1”,“Address2”,“City”,“State”,“Zip5”,“Zip4”必须针对每个地址重复,这实际上大大增加了json的大小。
Is there any way I could eliminate the need of necessarily having these keys in the JSON yet have those values for each address? If I had to represent values of "ID", "Firmname", etc as an array [Ex: ["0","firmname","address1here",..] should I be concerned about the order of the values?
Will parsing become obscure if I represent them as an array of values (rather than multiple key value pair)?
Will it be a "good" JSON structure (as I would have to forfeit the readability) if I choose to represent it as an array of values directly?
"Address": [ { "-ID": "0", "FirmName": "firmname", "Address1": "address1here", "Address2": "13 infinite loop", "City": "new york", "State": "NY", "Zip5": "zip5here", "Zip4": "zip4here" }, { "-ID": "1", "FirmName": "firmhere", "Address1": "address1here", "Address2": "1 Smith Ct ", "City": "San Predo", "State": "CA", "Zip5": "ziphere", "Zip4": "ziphere1" }, { "-ID": "1", "FirmName": "firmhere", "Address1": "address1here", "Address2": "12 John Rd ", "City": "Newark", "State": "PA", "Zip5": "ziphere", "Zip4": "ziphere1" } ]