Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Most simple way:</p> <pre><code>{ "Jonathan Smith": { "Adam": { "Suzy": {}, "Clare": {}, "Aaron": {}, "Simon": {} }, "Timmy": {}, "Alison": { "Natasha": {}, "Zak": {} } } } </code></pre> <p>More powerful structure:</p> <pre><code>{ "Smiths": { "Jonathan Smith": { "id": 0}, "Adam Smith": { "id": 1, "father": 0 }, "Suzy Smith": { "id": 4, "father": 1 }, "Clare Smith": { "id": 5, "father": 1 }, "Aaron Smith": { "id": 6, "father": 1 }, "Simon Smith": { "id": 7, "father": 1 }, "Timmy Smith": { "id": 2, "father": 0 }, "Alison Smith": { "id":3, "father": 0 }, "Natasha Smith": { "id": 8, "father": 3 }, "Zak Smith": { "id": 9, "father": 3 } } } </code></pre> <p>Add more relations, mother, husband and wife.</p> <pre><code>{ "Smiths": { "Jonathan Smith": { "id": 0, "wife": [10]}, "Suzan Smith": { "id": 10, "born": "Suzan Jones", "husband": [0] }, "Adam Smith": { "id": 1, "father": 0, "mother": 10 }, "Suzy Smith": { "id": 4, "father": 1 }, "Clare Smith": { "id": 5, "father": 1 }, "Aaron Smith": { "id": 6, "father": 1 }, "Simon Smith": { "id": 7, "father": 1 }, "Timmy Smith": { "id": 2, "father": 0, "mother": 10 }, "Alison Smith": { "id":3, "father": 0, "mother": 10 }, "Natasha Smith": { "id": 8, "father": 3 }, "Zak Smith": { "id": 9, "father": 3 } } } </code></pre> <p>Sometimes it is much easier to work with JSON using Javascript</p> <pre><code>var familyTree = {} familyTree["Dick Jones"] = { id: 1234, father: 213 } </code></pre> <p>This will allow you to add, delete, use functions, be able to check for errors, and then just get the resulting JSON by calling:</p> <pre><code>JSON.stringify(familyTree) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload