How to use the prototype function from bson

Find comprehensive JavaScript bson.prototype code examples handpicked from public code repositorys.

28
29
30
31
32
33
34
35
36
37
38
/*!
 * Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299
 */


if (!ObjectId.prototype.hasOwnProperty('valueOf')) {
  ObjectId.prototype.valueOf = function objectIdValueOf() {
    return this.toString();
  };
}

fork icon0
star icon0
watch icon0