Skip to content

Instantly share code, notes, and snippets.

@mikesparr
Created January 5, 2021 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikesparr/adab7af9af1e5a0047bcb88dd273b8f8 to your computer and use it in GitHub Desktop.
Save mikesparr/adab7af9af1e5a0047bcb88dd273b8f8 to your computer and use it in GitHub Desktop.
JSON data structure comparison
// traditional JSON hashmap
{
"data": [
{"batch_id": "abc",
"records": [
{"subject_id": "111", "features": [1,2,3,4]},
{"subject_id": "222", "features": [1,2,3,4]},
{"subject_id": "333", "features": [1,2,3,4]},
{"subject_id": "444", "features": [1,2,3,4]},
{"subject_id": "555", "features": [1,2,3,4]}
]
}
]
}
// compare to demo app structure
{
"batch_id": "abc",
"subjects": ["111","222","333","444","555"],
"features: [[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment