From 0025d0051fa46f285a3af867f60f2de2ec276526 Mon Sep 17 00:00:00 2001 From: chenos Date: Sat, 20 Nov 2021 13:56:47 +0800 Subject: [PATCH] feat: update repository api doc --- docs/reference/repository.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/reference/repository.md b/docs/reference/repository.md index ab4f45527..28a213b69 100644 --- a/docs/reference/repository.md +++ b/docs/reference/repository.md @@ -421,6 +421,31 @@ await repository.findOne({ }); ``` +## repository.count() + + +##### Definition + +```ts +interface count { + (options?: CountOptions): Promise; +} + +interface CountOptions extends Sequelize.CountOptions { + filter?: any; +} +// Sequelize.CountOptions 的参数说明 +// distinct 就不传了,自动处理,有关联数据时,distinct=true +``` + +##### Examples + +```ts +repository.count({ + filter: {}, +}); +``` + ## repository.create() 创建数据