From 12cc5b917426e85950751cee32506b13ac0043aa Mon Sep 17 00:00:00 2001 From: Pearl C <63629092+pearl-cao@users.noreply.github.com> Date: Thu, 26 Jan 2023 23:04:02 +0800 Subject: [PATCH] Update repository.md --- docs/en-US/api/database/repository.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/en-US/api/database/repository.md b/docs/en-US/api/database/repository.md index cf6570d52..4735d6d99 100644 --- a/docs/en-US/api/database/repository.md +++ b/docs/en-US/api/database/repository.md @@ -34,6 +34,7 @@ userRepository.find({ }); ``` + #### Operator The `filter` parameter in the `Repository` also provides a variety of operators to perform more diverse queries. @@ -170,7 +171,6 @@ await userRepository.create([ age: 20, }, ]) - ``` #### Create Association @@ -388,6 +388,7 @@ Find datasets from the database with the specified filtering conditions and sort * `async find(options?: FindOptions): Promise` **Type** + ```typescript type Filter = FilterWithOperator | FilterWithValue | FilterAnd | FilterOr; type Appends = string[]; @@ -515,6 +516,7 @@ Query a certain amount of data from the database for specific conditions. Equiva * `count(options?: CountOptions): Promise` **Type** + ```typescript interface CountOptions extends Omit, Transactionable { filter?: Filter; @@ -533,7 +535,6 @@ const count = await books.count({ }); ``` - ### `findAndCount()` Find datasets from the database with the specified filtering conditions and return the number of results. Equivalent to `Model.findAndCountAll()` in Sequelize. @@ -543,6 +544,7 @@ Find datasets from the database with the specified filtering conditions and retu * `async findAndCount(options?: FindAndCountOptions): Promise<[Model[], number]>` **Type** + ```typescript type FindAndCountOptions = Omit & CommonFindOptions; ``` @@ -588,6 +590,7 @@ Inserts multiple newly created data into the data table. This is equivalent to c * `createMany(options: CreateManyOptions): Promise` **Type** + ```typescript interface CreateManyOptions extends BulkCreateOptions { records: Values[];