ContentGroup.find(options)
参数说明
options:
请求示例
try {
ContentList data = await ContentGroup.find(withCount: true, offset: 0, limit: 20);
} catch (e) {
// 操作失败
}
返回示例
返回 ContentList 类型。详见数据类型章节。
ContentGroup.get(contentGroupID)
参数说明
请求示例
返回示例
返回 ContentGroup 类型。详见数据类型章节。
以下操作都需指明操作的内容库,方法如下:
ContentGroup myContentGroup = new ContentGroup(contentGroupID)
参数说明
myContentGroup.getContent(richTextID, select: select, expand: expand)
参数说明
info 如果有自定义字段,则一并返回。
visit_count 字段,只有在已经开通了[“文章统计”(“阅读数支持”)功能](https://cloud.minapp.com/dashboard/#/app/[[app_id | addSlashPostfixIfNotEmpty]]settings/info/),且该文章的阅读数大于 0 时,才会返回。
“文章阅读数统计”是一个异步的操作,统计结果略有延迟。
请求示例
返回示例
返回 Content 类型。详见数据类型章节。
myContentGroup.count()
myContentGroup.query(options)
参数说明
options:
内容查询与数据表查询方法一致。
info > myContentGroup.query() 接口返回的内容中,不包含 content 字段。
请求示例
select 使用方法可以参考数据表 - 字段过滤小节
expand 使用方法可以参考数据表 - 字段扩展小节
假设 _richtextcontent 表中有一个类型为 pointer 的字段,名称为 pointer_test_oder, 指向了 test_order 表
请求示例 1
请求示例 2
myContentGroup.getCategory(categoryID)
OBJECT 参数说明
返回参数
请求示例
返回示例
返回 ContentCategory 类型。详见数据类型章节。
myContentGroup.getCategoryList()
请求示例
内容查询的分页与排序操作和数据表分页与排序方法一致。
ContentCategory
ContentCategory 表示内容所属的分类。
子类列表,元素类型为 ContentCategory
ContentList 表示一次查询数据库所返回的内容列表以及元数据。
info 返回结果默认不包含 total_count,如需获取该值可以在设置查询条件 Query 时,通过设置 query.withTotalCount(true) 来获取 total_count。详见获取记录总数
ContentCategoryList
ContentCategoryList 表示一次查询数据库所返回的内容分类列表以及元数据。
内容分类列表,每个元素为 ContentCategory 类型
info 返回结果默认不包含 total_count,如需获取该值可以在设置查询条件 Query 时,通过设置 query.withTotalCount(true) 来获取 total_count。详见获取记录总数