Skip to content

Commit 3e6fe39

Browse files
authored
fix(docs): add details of additional methods provided (#149)
such as for findAll, countAll, deleteHard etc. GH-148
1 parent bf2b985 commit 3e6fe39

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,18 @@ export class ItemRepository extends SoftCrudRepositoryMixin<
222222
}
223223
```
224224

225+
## Additional Repository Methods
226+
227+
Following are some additional methods that you can use when working with repositories in your application, either by extending the base repositories provided or by using the [SoftCrudRepositoryMixin](#softcrudrepositorymixin):
228+
229+
1. `findAll` - This method is similar to `find`, but it returns entries including soft deleted ones.
230+
2. `deleteHard` - This method is used to perform a hard delete on a specified entity.
231+
3. `deleteByIdHard` - This method is used to perform a hard delete of an entity based on the provided ID.
232+
4. `findByIdIncludeSoftDelete` - This method is similar to `findById`, but it returns the entity even if it is soft deleted.
233+
5. `deleteAllHard` - This method is used to perform a hard delete of multiple entities based on a specified condition.
234+
6. `findOneIncludeSoftDelete` - This method is similar to `findOne`, but it returns a single entity even if it is soft deleted.
235+
7. `countAll` - This method is similar to `count`, but it returns the total count of all entities including soft deleted ones.
236+
225237
### deletedBy
226238

227239
Whenever any entry is deleted using deleteById, delete and deleteAll repository methods, it also sets deletedBy column with a value with user id whoever is logged in currently. Hence it uses a Getter function of IUser type. However, if you want to use some other attribute of user model other than id, you can do it by overriding deletedByIdKey. Here is an example.

0 commit comments

Comments
 (0)