JSON hierarchies encoding and event-capture -


consider following json structure:

{'100': {'time': '02:00:00', 'group': 'a', 'similar events': [101, 102, 104, 120], '101': {'time': '02:01:00', 'group': 'b', 'similar events': [100, 103, 105, 111], '102': {'time': '04:00:00', 'group': 'a', 'similar events': [104, 100, 107, 121]} 

the top-level keys (e.g. '100', '101', etc.) unique identifiers. have come find not ideal way store json (attempting load structure - many more events - crashed pc).

after digging, believe proper way (or, @ least, more canonical way) of encoding these data in json:

{'time': [{'100': '02:00:00'},           {'101': '02:01:00'},           {'102': '04:00:00'}],  'group': [{'100': 'a'},           {'101': 'b'},            {'102': 'a'}],  'similar events': [{'100': [101, 102, 104, 120]},                    {'101': [100, 103, 105, 111]},                    {'102': [104, 100, 107, 121]}]} 

my machine able handle better last attempt. why former method of using unique events (what think are) individual "rows" cause trouble? gut tells me each "column" or key within each record in former try becomes new field since it's found under unique identifier (a unique key).

it's difficult without more details such total size of data, amount of memory on computer, software you're using , specific operations your're trying may working set of second representation smaller problem.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -