Given that I have say three model objects: Parent, Child and NestedChild, where the Parent model contains an array of referenced Child models which in turn also contains an array of referenced NestedChild models.
For example
const parent = ottoman.model("Parent", {
child: [{ref: "Child"}],
foo: "string"
});
const child= ottoman.model("Child", {
nestedChild: [{ref: "NestedChild"}],
bar: "string"
});
const nestedChild= ottoman.model("NestedChild", {
baz: "string"
});
I understand how to get the child reference such as:
getNestedObjects.find({}, {load: 'child'}, function(err, results) {
// results will be populated here...
})
which returns
{
"parent": [
{
"child": [
{
"nestedChild": [
null,
null,
null
],
"foo": "Foo"
}
],
"bar": "Bar"
}
]
}
As you can see the NestedChild objects return as null.
My question is how do I load the NestedChild and any other children below that however deep?