You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 31, 2024. It is now read-only.
Copy file name to clipboardexpand all lines: CHANGELOG.md
+12-5
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,16 @@ All notable changes to this project will be documented in this file. This projec
14
14
15
15
### Removed
16
16
17
+
## [0.4.0]
18
+
19
+
### Added
20
+
21
+
- Custom fetch: For `db()` and `collection()`, there is now a chainable `fetch()` method, which returns a new DB or collection with its `fetch` implementation changed. This allows you to implement your own custom logic for retries, without the addition of pRetry
22
+
23
+
### Removed
24
+
25
+
- Removed pRetry dependency in favor of users overriding via their own fetch function
-`altFetch` - An alternate `fetch` implementation that will be used for that point forward. Useful for adding or removing retry support on a per-call level, changing the authentication required, or other fetch middleware operations.
160
+
151
161
## Collection Methods
152
162
153
163
The following [Data API resources](https://www.mongodb.com/docs/atlas/api/data-api-resources/) are supported
@@ -302,6 +312,7 @@ Requests via `fetch()` have their resposne codes checked against the [Data API E
302
312
303
313
-**Why is `mongodb` in the dependencies?**[TypeScript requires it](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#dependencies), however, the mongodb dependency is types-only and will not be included in your built lambda when using `tsc`, `rollup`, `webpack`, etc. You can verify that mongo is not included by looking at the [CommonJS build](https://www.npmjs.com/package/@taskless/mongo-data-api?activeTab=code).
304
314
-**Why is `node-fetch`'s `fetch` not of the correct type?**`node-fetch`'s `fetch` isn't a true `fetch` and wasn't typed as one. To work around this, you can either use [`cross-fetch`](https://github.com/lquixada/cross-fetch) which types the `fetch` API through a type assertion, or [perform the type assertion yourself](https://github.com/lquixada/cross-fetch/blob/main/index.d.ts): `fetch: _fetch as typeof fetch`. It's not ideal, but with proper `fetch` coming to node.js, it's a small inconvienence in the short term.
315
+
-**How do I retry failed `fetch` calls?**`fetch-retry` ([github](https://github.com/jonbern/fetch-retry)) is an excellent library. You can also use a lower level retry tool like `p-retry` ([github](https://github.com/sindresorhus/p-retry)) if you want to manage more than just the `fetch()` operation itself.
0 commit comments