Skip to content

Commit

Permalink
Merge pull request #24 from jhomarolo/main
Browse files Browse the repository at this point in the history
feat: add delete method
  • Loading branch information
jhomarolo authored Jun 18, 2022
2 parents 95dcbb3 + eed94b6 commit 08f7cd3
Show file tree
Hide file tree
Showing 7 changed files with 11,072 additions and 56 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,15 @@ const repo = new ItemRepository(injection)
const ret = await repo.find({ _id : { $in : [`4323fefwed4234`, '3432d23232dfff'] } } )
```

- `findAll`
You also findAll records using the native find without filters

```javascript
const repo = new ItemRepository(injection)
const ret = await repo.find({ } )
```


### `findByID`
Find entities by IDs

Expand Down Expand Up @@ -289,14 +298,30 @@ const ret = await repo.deleteByID(entity)
Delete a group of Entities.
Format: `.deleteMany(entity)` where `entity` is a Entity instance to be deleted.
Format: `.deleteMany(options = { filter})` where `options` is a set of filters to be deleted.
Return: `true` for success or `false` for error
```javascript
const repo = new ItemRepository(injection)
let filterDefinition = { numberTest : [aModifiedInstance.numberTest] }
const ret = await repo.deleteMany({ filter: filterDefinition })
```
### `delete`
Delete an Entitie.
Format: `.delete(entity)` where `entity` is a Entity instance to be deleted.
Return: `true` for success or `false` for error
```javascript
const repo = new ItemRepository(injection)
const ret = await repo.delete(aModifiedEntity)
```
Expand Down
Loading

0 comments on commit 08f7cd3

Please sign in to comment.