# [Collection](/miniprogram/dev/wxcloudservice/wxcloud/reference-sdk-api/database/Collection).limit(value: number): [Collection](/miniprogram/dev/wxcloudservice/wxcloud/reference-sdk-api/database/Collection)

> 支持端：[小程序](/miniprogram/dev/framework/client-lib/version.md), [云函数](/miniprogram/dev/wxcloudservice/wxcloud/reference/changelog-server-sdk), [Web](/miniprogram/dev/wxcloudservice/wxcloud/reference/changelog-web-sdk)

指定查询结果集数量上限

## 参数

### value: number

## 返回值

### [Collection](/miniprogram/dev/wxcloudservice/wxcloud/reference-sdk-api/database/Collection)

## 说明

`limit` 在小程序端默认及最大上限为 20，在云函数端默认及最大上限为 1000

## 示例代码

```js
db.collection('todos').limit(10)
  .get()
  .then(console.log)
  .catch(console.error)
```
