# How to keep following records in json format

**URL:** <https://discuss.jsonapi.org/t/how-to-keep-following-records-in-json-format/1837>\
**Category:** Uncategorized\
**Created:** [February 19, 2020, 12:04pm UTC](https://discuss.jsonapi.org/t/how-to-keep-following-records-in-json-format/1837 "2020-02-19T12:04:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajemessage](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@rajemessage](https://discuss.jsonapi.org/u/rajemessage)\
**Post date:** [February 19, 2020, 12:04pm UTC](https://discuss.jsonapi.org/t/how-to-keep-following-records-in-json-format/1837/1 "2020-02-19T12:04:25Z")

</div>

hi, we need to keep some related record in json.

ex set1  
level1, level2 , level3 (this can be n numbers), weitage9in percent)  
a , null ,null, 10 (here “a” is at first level has weitage10)  
a ,b, null, 20 (“b” is inside “a” and got weitage 20)  
a ,b, c, 5(“c” is inside “b” and got weithage 5)  
a ,b, d, 8 (“d” is inside “b” and got weithage8)  
ax ,null, null, 3(here “ax” is at first level has weitage10)  
ax ,b, null, 8(same as above)  
ax ,b, c, 9(same as above)  
–so level1 will be unique but it will repeat if it has got any one inside it.  
so uniqueness of the record is no of levels.  
so there uniquness is on  
level1.level2,level3

ex set2  
level1,level2,level3 level4,weitage  
axx ,null, null, null, 3(here “ax” is at first level has weitage10)  
axx ,b, null, null,8(same as top most ex set)  
axx ,b, c, null,9(same as top most ex set)  
axx ,b, c,d,10(same as top most ex set)  
the leaf node could be many but uniques , so there uniquness is on  
level1.level2,level3,leve4

and both ex set1 and ex set2 can come together.

now requirement is we should be able to traverse from each leaf node to topmost node.and vise versa uniquly.

so please suggest that how we should keep these tow bunch where level can increase at any time in json.
