如何使用 javascript sdk 在内容丰富的 getEntry 调用中获取包含的对象?

How can I get included objects in a contentful getEntry call using javascript sdk?

我看到我可以使用 node.js javascript api 在 getEntries 方法中传递一个带有 include:2 的查询对象。我如何使用 getEntry 调用 returns 单个对象来做到这一点。

// 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 且只有 1 个条目。如果要包含 1 个父条目(也称为多个条目)的链接条目,则必须使用 getEntries 方法并指定要检索的父条目的 sys.id。像这样:

client.getEntries({'sys.id': '<entry_id>'})
.then(entries => {
  ...
})