mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: update to mongodb5 (#514)
This commit is contained in:
1 parent
5a02010120
commit
0685b88066
59 files changed
+610
-601
No files matched your search
@@ -5,7 +5,7 @@ import { Duplex } from 'stream';
|
||||
import { inspect } from 'util';
|
||||
import fs from 'fs-extra';
|
||||
import moment, { isMoment, Moment } from 'moment-timezone';
|
||||
import { ObjectID } from 'mongodb';
|
||||
import { ObjectId } from 'mongodb';
|
||||
import Logger from 'reggol';
|
||||
export * as yaml from 'js-yaml';
|
||||
export * as fs from 'fs-extra';
|
||||
@@ -128,7 +128,7 @@ export namespace Time {
|
||||
else if (isMoment(timestamp)) _timestamp = timestamp.toDate().getTime();
|
||||
else _timestamp = timestamp.getTime();
|
||||
const hexSeconds = Math.floor(_timestamp / 1000).toString(16);
|
||||
return new ObjectID(`${hexSeconds}${allZero ? '0000000000000000' : new ObjectID().toHexString().substr(8)}`);
|
||||
return new ObjectId(`${hexSeconds}${allZero ? '0000000000000000' : new ObjectId().toHexString().substr(8)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user