Skip to content

Commit 365a452

Browse files
committed
docs: add migration guide
1 parent e14716a commit 365a452

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## mongodb-downloader
2+
3+
A simple library to download MongoDB binaries for different platforms and versions.
4+
5+
### Migrating from v0.4 to v0.5
6+
7+
In v0.5.x, the library introduced lockfiles to prevent parallel downloads of the same MongoDB binary. It also changed the arguments for the `downloadMongoDb` and `downloadMongoDbWithVersionInfo` functions, introducing a new `useLockfile` field and using a single options object instead of separate parameters for different options. It is recommended to enable lockfiles to prevent redundant downloads unless you have a specific reason not to.
8+
9+
```ts
10+
// Before (v0.4.x)
11+
downloadMongoDb('/tmp/directory', '4.4.6', {
12+
platform: 'linux',
13+
arch: 'x64',
14+
});
15+
16+
downloadMongoDbWithVersionInfo('/tmp/directory', '4.4.6', {
17+
arch: 'x64',
18+
});
19+
20+
// After (v0.5.x)
21+
downloadMongoDb({
22+
downloadDir: '/tmp/directory',
23+
version: '4.4.6',
24+
useLockfile: true, // New, required field.
25+
downloadOptions: {
26+
platform: 'linux',
27+
arch: 'x64',
28+
},
29+
});
30+
31+
downloadMongoDbWithVersionInfo({
32+
downloadDir: '/tmp/directory',
33+
version: '4.4.6',
34+
useLockfile: true, // New, required field.
35+
downloadOptions: {
36+
arch: 'x64',
37+
},
38+
});
39+
```

0 commit comments

Comments
 (0)