Best approach to represent bi-directional relationships?

How best to represent the following:

// array of parent objects
[{
    "id": 1,
    "name": "Bob Smith",
    "children": [ 3 ]
},
{
    "id": 2,
    "name": "Jane Smith",
    "children": [ 3 ]
}]

// array of children objects
[{
    "id": 3,
    "name": "Martin Smith",
    "parents": [ 1,2 ]
}]

The idea here that we’d need at least 2 schema, parents and children. But there is a interdependency. Elements in the children array should exist as valid children id’s. Conversely, elements in the parents array should exist as valid parent id’s.

Generally you use datasets to create relationships.

See https://www.youtube.com/watch?v=XATDlwG1azU&list=PLKMZcxOsC3u0Y-4CHg5SDpVjTcrvGttTt&index=1