code: function createObjectId() {
      var
          s = Math.floor(Math.random() * 0xffffffff).toString(16),
          padding = 8 - s.length;
      while (padding > 0) {
          s = '0' + s;
          padding--;
      }
      return s;
  }
docs: generate random object ID as 'ffffffff':