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
+47-32Lines changed: 47 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ BSON is short for "Binary JSON," and is the binary-encoded serialization of JSON
4
4
You can learn more about it in [the specification](http://bsonspec.org).
5
5
6
6
### Table of Contents
7
+
7
8
-[Usage](#usage)
8
9
-[Bugs/Feature Requests](#bugs--feature-requests)
9
10
-[Installation](#installation)
@@ -18,7 +19,7 @@ Think you've found a bug? Want to see a new feature in `bson`? Please open a cas
18
19
2. Navigate to the NODE project: [jira.mongodb.org/browse/NODE](https://jira.mongodb.org/browse/NODE)
19
20
3. Click **Create Issue** - Please provide as much information as possible about the issue and how to reproduce it.
20
21
21
-
Bug reports in JIRA for all driver projects (i.e. NODE, PYTHON, CSHARP, JAVA) and the Core Server (i.e. SERVER) project are **public**.
22
+
Bug reports in JIRA for the NODE driver project are **public**.
22
23
23
24
## Usage
24
25
@@ -67,41 +68,52 @@ If you are working directly in the browser without a bundler please use the `.mj
67
68
npm install bson
68
69
```
69
70
71
+
### MongoDB Node.js Driver Version Compatibility
72
+
73
+
Only the following version combinations with the [MongoDB Node.js Driver](https://github.com/mongodb/node-mongodb-native) are considered stable.
| value | <code>object</code> || The value to convert to extended JSON |
122
-
|[replacer]| <code>function</code> \| <code>array</code> || A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string |
123
-
|[space]| <code>string</code> \| <code>number</code> || A String or Number object that's used to insert white space into the output JSON string for readability purposes. |
| value | <code>object</code> || The value to convert to extended JSON|
135
+
|[replacer]| <code>function</code> \| <code>array</code> || A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string |
136
+
|[space]| <code>string</code> \| <code>number</code> || A String or Number object that's used to insert white space into the output JSON string for readability purposes.|
| ejson | <code>object</code> | The Extended JSON object to deserialize|
162
177
|[options]| <code>object</code> | Optional settings passed to the parse method |
163
178
164
179
Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types
@@ -194,7 +209,7 @@ BSON vendors the required polyfills for `TextEncoder`, `TextDecoder`, `atob`, `b
194
209
npm install --save react-native-get-random-values
195
210
```
196
211
197
-
The following snippet should be placed at the top of the entrypoint (by default this is the root `index.js` file) for React Native projects using the BSON library. These lines must be placed for any code that imports `BSON`.
212
+
The following snippet should be placed at the top of the entrypoint (by default this is the root `index.js` file) for React Native projects using the BSON library. These lines must be placed for any code that imports `BSON`.
198
213
199
214
```typescript
200
215
// Required Polyfills For ReactNative
@@ -211,7 +226,7 @@ This will cause React Native to import the `node_modules/bson/lib/bson.rn.cjs` b
211
226
212
227
### Technical Note about React Native module import
213
228
214
-
The `"exports"` definition in our `package.json` will result in BSON's CommonJS bundle being imported in a React Native project instead of the ES module bundle. Importing the CommonJS bundle is necessary because BSON's ES module bundle of BSON uses top-level await, which is not supported syntax in [React Native's runtime hermes](https://hermesengine.dev/).
229
+
The `"exports"` definition in our `package.json` will result in BSON's CommonJS bundle being imported in a React Native project instead of the ES module bundle. Importing the CommonJS bundle is necessary because BSON's ES module bundle of BSON uses top-level await, which is not supported syntax in [React Native's runtime hermes](https://hermesengine.dev/).
0 commit comments