Skip to content

Commit

Permalink
update: doc for bulk put (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
aparzi authored Mar 31, 2024
1 parent 46a012f commit 85eaa92
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,23 @@ this.dbService.bulkGet('people', [1, 3, 5]).subscribe((result) => {
});
```

### bulkPut<T>(storeName: string, values: Array<T & { key?: any }>): Observable<number[]>

Adds or updates a record in store with the given value and key. Return all items present in the store

- @param storeName The name of the store to update
- @param items The values to update in the DB

@Return The return value is an Observable with the primary key of the object that was last in given array

@error If the call to bulkPut fails the transaction will be aborted and previously inserted entities will be deleted

```typescript
this.dbService.bulkPut('people', people).subscribe((result) => {
console.log('result: ', result);
});
```

### update<T>(storeName: string, value: T): Observable<T[]>

Adds or updates a record in store with the given value and key. Return item updated
Expand Down Expand Up @@ -422,4 +439,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
17 changes: 17 additions & 0 deletions projects/ngx-indexed-db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,23 @@ this.dbService.bulkGet('people', [1, 3, 5]).subscribe((result) => {
});
```

### bulkPut<T>(storeName: string, values: Array<T & { key?: any }>): Observable<number[]>

Adds or updates a record in store with the given value and key. Return all items present in the store

- @param storeName The name of the store to update
- @param items The values to update in the DB

@Return The return value is an Observable with the primary key of the object that was last in given array

@error If the call to bulkPut fails the transaction will be aborted and previously inserted entities will be deleted

```typescript
this.dbService.bulkPut('people', people).subscribe((result) => {
console.log('result: ', result);
});
```

### update<T>(storeName: string, value: T): Observable<T[]>

Adds or updates a record in store with the given value and key. Return item updated
Expand Down

0 comments on commit 85eaa92

Please sign in to comment.