contentful - 在 Contentful SDK 中选择 Operator
问题描述
如何在 Javascript SDK 中使用 Contentful Select Operator 来仅选择属性:字段?
文档中的 GET 请求如下所示
GET https://cdn.contentful.com/spaces/<space-id>/entries/?select=fields
解决方案
const contentful = require('contentful')
const client = contentful.createClient({
space: '<space_id>',
accessToken: '<content_delivery_api_key>'
})
client.getEntries({
content_type: '<content_type_id>',
select: 'sys.id,fields.<field_name>'
})
.then((response) => console.log(response.items))
.catch(console.error)
推荐阅读
- java - 具有基本抢先式身份验证的 Java Web 服务客户端
- c# - 当文件类型为 .jsx 时,Visual Studio 2019 无法在差异中编辑
- android-studio - gpu 找到了。vendor id 10de device if 0x174d 检查错误的 AMD Vulkan 驱动程序版本
- .net - Visual Studio 2019 中缺少发布菜单项
- c - 是否可以用无符号机器字实现扩展欧几里得算法?
- java - 即使使用 FLAG_UPDATE_CURRENT,PendingIntent 也不会在 api24 及更高版本上传递可序列化的附加内容
- excel - 使用宏跨工作表的循环求解器
- flutter - Flutter:使自定义底栏出现时向上滑动
- corda - corda 应用程序设计所需的指导
- python - Python 将打印给定函数的列表名称