From 394deb7d9a8b987cf6f40adb205e4e3b3810aed3 Mon Sep 17 00:00:00 2001 From: "Krueger, Brandon" Date: Wed, 21 Oct 2015 08:02:06 -0500 Subject: [PATCH] Updating ObjectID to match current spec --- mongodb/mongodb.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mongodb/mongodb.d.ts b/mongodb/mongodb.d.ts index 2fc3f0227..81fa6ae00 100644 --- a/mongodb/mongodb.d.ts +++ b/mongodb/mongodb.d.ts @@ -127,6 +127,14 @@ declare module "mongodb" { // Creates an ObjectID from a hex string representation of an ObjectID. // hexString – create a ObjectID from a passed in 24 byte hexstring. public static createFromHexString(hexString: string): ObjectID; + + // Checks if a value is a valid bson ObjectId + // id - Value to be checked + public static isValid(id: string): Boolean; + + // Generate a 12 byte id string used in ObjectID's + // time - optional parameter allowing to pass in a second based timestamp + public static generate(time?: number): string; } // Class documentation : http://mongodb.github.io/node-mongodb-native/api-bson-generated/binary.html