未验证 提交 3e91dd7a 编写于 作者: W wanganxp 提交者: GitHub

Update cf-database.md

上级 74370873
......@@ -420,16 +420,18 @@ let res = await collection.orderBy("name", "asc").get()
collection.field()
从查询结果集中,过滤掉不需要的字段,或者指定要返回的字段。
参数说明
| 参数 | 类型 | 必填 | 说明 |
| ---- | ------ | ---- | --------------------------------------- |
| - | object | 是 | 要过滤的字段,不返回传false,返回传true |
| - | object | 是 | 过滤字段对象,包含字段名和策略,不返回传false,返回传true |
使用示例
```js
collection.field({ 'age': true })
collection.field({ 'age': true }) //只返回age字段,其他字段不返回
```
备注:只能指定要返回的字段或者不要返回的字段。即{'a': true, 'b': false}是一种错误的参数格式
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册