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
Copy file name to clipboardExpand all lines: README.md
+15-14
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,20 @@
2
2
3
3
The official [MongoDB](https://www.mongodb.com/) driver for Node.js.
4
4
5
-
**Upgrading to version 4? Take a look at our [upgrade guide here](https://github.com/mongodb/node-mongodb-native/blob/4.1/docs/CHANGES_4.0.0.md)!**
5
+
**Upgrading to version 4? Take a look at our [upgrade guide here](https://github.com/mongodb/node-mongodb-native/blob/HEAD/docs/CHANGES_4.0.0.md)!**
Some of these packages include native C++ extensions, consult the [trouble shooting guide here](https://github.com/mongodb/node-mongodb-native/blob/4.1/docs/native-extensions.md) if you run into issues.
82
+
Some of these packages include native C++ extensions. Consult the [trouble shooting guide here](https://github.com/mongodb/node-mongodb-native/blob/HEAD/docs/native-extensions.md) if you run into issues.
82
83
83
84
## Quick Start
84
85
@@ -239,7 +240,7 @@ For more detailed information, see the [indexing strategies page](https://docs.m
239
240
240
241
## Error Handling
241
242
242
-
If you need to filter certain errors from our driver we have a helpful tree of errors described in [docs/errors.md](https://github.com/mongodb/node-mongodb-native/blob/4.1/docs/errors.md).
243
+
If you need to filter certain errors from our driver we have a helpful tree of errors described in [docs/errors.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/docs/errors.md).
243
244
244
245
It is our recommendation to use `instanceof` checks on errors and to avoid relying on parsing `error.message` and `error.name` strings in your code.
245
246
We guarantee `instanceof` checks will pass according to semver guidelines, but errors may be sub-classed or their messages may change at any time, even patch releases, as we see fit to increase the helpfulness of the errors.
There are collections of tests that test features requiring a specialized set of environment variables to be generated and set in order to run. Look below for the section that applies to the feature you are trying to test.
6
+
7
+
### Serverless
8
+
9
+
Find the following script in driver-evergreen-tools and make sure you have the following environment variables defined.
10
+
_**Remember**_ some of these are sensitive credentials so keep them safe and only put them in your environment when you need them.
this will output an evergreen expansion in `serverless-expansion.yml` in the current working directory.
25
+
26
+
```yml
27
+
MONGODB_URI: xxx
28
+
MONGODB_SRV_URI: xxx
29
+
SERVERLESS_INSTANCE_NAME: xxx
30
+
SSL: xxx
31
+
AUTH: xxx
32
+
TOPOLOGY: xxx
33
+
SERVERLESS: xxx
34
+
MULTI_ATLASPROXY_SERVERLESS_URI: xxx
35
+
SINGLE_ATLASPROXY_SERVERLESS_URI: xxx
36
+
```
37
+
38
+
Since it's a flat yaml file, you can run the following to get a sourceable environment file:
39
+
40
+
```sh
41
+
cat serverless-expansion.yml | sed 's/: /=/g' > serverless.env
42
+
```
43
+
44
+
Before sourcing `serverless.env`, make some adjustments that are equivalent to what our EVG does:
45
+
46
+
- Change `MONGODB_URI` to be the same as `SINGLE_ATLASPROXY_SERVERLESS_URI`
47
+
- Add `SINGLE_MONGOS_LB_URI` and `MULTI_MONGOS_LB_URI` and set them to `SINGLE_ATLASPROXY_SERVERLESS_URI`
48
+
49
+
Lastly, comment out the `source` of `install-dependencies.sh` command in `.evergreen/run-serverless-tests.sh` and you can run that script directly to test serverless instances from your local machine.
50
+
51
+
### Load Balanced
52
+
53
+
You'll first need to start a sharded cluster using your favorite MongoDB orchestration tool of choice.
54
+
The tool should create a cluster with two mongos so you have a uri like `MONGODB_URI=mongodb://host1,host2/`
55
+
Then you need to start a load balancer: you can install `haproxy` on macos via `brew` and use the script provided in drivers-evergreen-tools.
As long as certain environment variables are present and mongodb-client-encryption is installed, FLE will run with a regular mocha execution: `npm run check:test`.
100
+
101
+
Define the following variables in your environment:
102
+
103
+
- `AWS_ACCESS_KEY_ID`
104
+
- `AWS_SECRET_ACCESS_KEY`
105
+
- `CSFLE_KMS_PROVIDERS`
106
+
- `AWS_REGION`
107
+
- `AWS_CMK_ID`
108
+
109
+
### TODO Special Env Sections
110
+
111
+
- Kerberos
112
+
- AWS Authentication
113
+
- OCSP
114
+
- TLS
115
+
- Atlas Data Lake
116
+
- LDAP
117
+
- Snappy (maybe in general, how to test optional dependencies)
0 commit comments