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
This version includes an upgrade from js-bson 1.x to js-bson 4.x.
332
+
333
+
#### Timestamps math operations return Javascript `Long`s
334
+
335
+
In versions prior to 4.x of the BSON library, Timestamps were represented with a custom class. In version 4.x of the BSON library, the Timestamp class was refactored to
336
+
be a subclass of the Javascript Long class. As a result of this refactor, math operations on Timestamp objects now return Long objects instead of Timestamp objects.
337
+
338
+
Math operations with Timestamps is not recommended. However, if Timestamp math must be used, the old behavior can be replicated by using the Timestamp
339
+
constructor, which takes a Long as an argument.
340
+
341
+
```typescript
342
+
const four =Timestamp.fromNumber(4);
343
+
const five =Timestamp.fromNumber(5);
344
+
const nine =newTimeStamp(four.add(five));
345
+
```
346
+
327
347
## Intentional Breaking Changes
328
348
329
349
-[`NODE-3368`](https://jira.mongodb.org/browse/NODE-3368): make name prop on error classes read-only ([#2879](https://github.com/mongodb/node-mongodb-native/pull/2879))
0 commit comments