Permalink
Browse files

Made the initial ObjectID random per the documentation.

  • Loading branch information...
1 parent 0ff93bb commit 3af8fac61efd320558acbd8eea1bccceb093054f @clayzermk1 clayzermk1 committed with christkv Jul 23, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 browser_build/bson.js
  2. +1 −1 lib/bson/objectid.js
View
@@ -3842,7 +3842,7 @@ ObjectID.prototype.getTimestamp = function() {
* @ignore
* @api private
*/
-ObjectID.index = 0;
+ObjectID.index = parseInt(Math.random() * 0xFFFFFF, 10);
ObjectID.createPk = function createPk () {
return new ObjectID();
View
@@ -176,7 +176,7 @@ ObjectID.prototype.getTimestamp = function() {
* @ignore
* @api private
*/
-ObjectID.index = 0;
+ObjectID.index = parseInt(Math.random() * 0xFFFFFF, 10);
ObjectID.createPk = function createPk () {
return new ObjectID();

0 comments on commit 3af8fac

Please sign in to comment.