提交 c0dcae32 编写于 作者: 雪洛's avatar 雪洛

docs: uniCloud

上级 5c24de08
......@@ -284,17 +284,6 @@ let res = await db.collection('goods').where({
}).count()
```
**注意**
使用阿里云时,count必须搭配where使用,此问题阿里云正在修复。如果要count所有记录可以使用一个必然满足的条件,比如下面这样:
```js
const dbCmd = db.command
let res = await db.collection('goods').where({
_id: dbCmd.exists(true)
}).count()
```
响应参数
| 字段 | 类型 | 必填 | 说明 |
......@@ -302,7 +291,6 @@ let res = await db.collection('goods').where({
| total | Number | 否 | 计数结果 |
### 设置记录数量
collection.limit()
......@@ -319,6 +307,10 @@ collection.limit()
let res = await collection.limit(1).get() // 只返回第一条记录
```
**注意**
- limit不设置的情况下默认返回100条数据,设置limit不可超过1000
### 设置起始位置
collection.skip(value)
......
......@@ -301,7 +301,9 @@ module.exports = async (event) => {
//云函数实例未复用时,每次返回0
//若实例被复用,则可能返回1、2、3等各种意外情况
}
```
```
**require由于存在缓存,也存在同样的问题。尽量不要直接修改require返回的内容**
### 临时存储空间
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册