Skip to content

Commit

Permalink
Merge pull request #6 from rashfael/master
Browse files Browse the repository at this point in the history
return correct string representation for JSON.stringify
  • Loading branch information
marcello3d committed Jun 29, 2015
2 parents 7f553a9 + f9abb5c commit 22adbd3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/objectid.js
Expand Up @@ -66,10 +66,15 @@ function ObjectId(bytes) {
}

}

ObjectId.prototype.toString = function() {
return toHex(this.bytes)
}

ObjectId.prototype.toJSON = function() {
return toHex(this.bytes)
}

var toHex = function(buffer) {
return buffer.toString('hex')
}
Expand Down

0 comments on commit 22adbd3

Please sign in to comment.