Javascript String toObjectId()

Description

Javascript String toObjectId()


'use strict';/*from  ww w .  j a  v  a  2s.c o  m*/

String.prototype.toObjectId = function() {
  var ObjectId = (require('mongoose').Types.ObjectId);
  return new ObjectId(this.toString());
};

Javascript String toObjectId()

String.prototype.toObjectId = function() {
    var ObjectId = (require('mongoose').Types.ObjectId);
    return new ObjectId(this.toString());
};



PreviousNext

Related