From 4e786d53cee6a08fdd1e21bfae02b4c0b0733da8 Mon Sep 17 00:00:00 2001 From: Samphan Raruenrom Date: Thu, 31 Aug 2017 13:13:16 +0700 Subject: [PATCH] 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. --- types/meteor/mongo.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/meteor/mongo.d.ts b/types/meteor/mongo.d.ts index af632bdab1..99f931ec28 100644 --- a/types/meteor/mongo.d.ts +++ b/types/meteor/mongo.d.ts @@ -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; }