indexOf(obj, fromIndex) {
    if (isBsonType(obj, 'ObjectId')) {
      obj = obj.toString();
    }

    fromIndex = fromIndex == null ? 0 : fromIndex;
    const len = this.length;
    for (let i = fromIndex; i < len; ++i) {
      if (obj == this[i]) {
        return i;
      }
    }
    return -1;
  }
Return the index of `obj` or `-1` if not found.

@param {Object} obj the item to look for
@param {Number} fromIndex
@return {Number}
@api public
@method indexOf
@memberOf MongooseArray