meteor: add methods to Mongo.ObjectID

These method are accessible from meteor Mongo.ObjectID but missing.

Per https://docs.meteor.com/api/collections.html#Mongo-ObjectID :
"Mongo.ObjectID follows the same API as the Node MongoDB driver ObjectID class"

When I check the Node.js MongoDB Driver API, only these two methods
are interesting. (getTimestamp()  doesn't make sense in Meteor).

I've a test that call both methods successfully.
This commit is contained in:
Samphan Raruenrom
2017-08-31 13:13:16 +07:00
parent fab36d348c
commit 4e786d53ce

View File

@@ -214,7 +214,10 @@ declare module "meteor/mongo" {
interface ObjectIDStatic {
new (hexString?: string): ObjectID;
}
interface ObjectID { }
interface ObjectID {
toHexString(): string;
equals(otherID: ObjectID): boolean;
}
function setConnectionOptions(options: any): void;
}