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: docs/upgrade-to-v5.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,12 +89,17 @@ This library no longer polyfills [ES Map](https://developer.mozilla.org/en-US/do
89
89
The following deprecated methods have been removed:
90
90
91
91
-`ObjectId.prototype.generate`
92
-
- Instead, generate a new ObjectId with the constructor: `new ObjectId()`
92
+
- Instead, generate a new ObjectId with the constructor: `new ObjectId()` or using the `static generate(time?: number)` method.
93
+
-`ObjectId.prototype.generationTime`
94
+
- Instead, use `static createFromTime()` and `getTimestamp()` to set and inspect these values on an `ObjectId()`
93
95
94
96
-`ObjectId.prototype.getInc`
95
97
-`ObjectId.prototype.get_inc`
96
98
-`ObjectId.get_inc`
97
-
- The `static getInc()` is private now since it has a side effect of changing the value of the next `ObjectId` generated, using `new ObjectId()` and inspecting the increment section of the bytes can provide insight into the current increment value.
99
+
- The `static getInc()` is private since invoking it increments the next `ObjectId` index, instead users should inspect the counter on newly created ObjectId if it is needed.
100
+
- See the following code snippet for how to obtain the counter field of an ObjectId:
98
101
99
-
-`ObjectId.prototype.generationTime`
100
-
- Instead, use `static createFromTime()` and `getTimestamp()` to set and inspect these values on an `ObjectId()`
0 commit comments