I see that I can pass a query object with include:2 in the getEntries method using the node.js javascript api. How can I do that with the getEntry call that returns a single object.
// how do I get the nested objects by passing the parameter include:1
client.getEntry('<entry_id>', {<what goes here?>})
.then(function (entry) {
// logs the entry metadata
})
getEntry returns 1 and only 1 entry. If you want to include the linked entries of 1 parent entry (aka more than one entry), you have to use the getEntries method and specify the sys.id of the parent entry you want to retrieve. Like so:
client.getEntries({'sys.id': '<entry_id>'})
.then(entries => {
...
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With