stringDocIDs = function (input) {
  if (input && typeof input === 'object') {
    switch (input._bsontype) {
      case 'ObjectId':
      case 'Long': {
        return input.toString();
      }
      case 'Binary': {
        if (input.sub_type === Binary.SUBTYPE_UUID) {
          return uuid4ToString(input);
        }
        return input.toJSON();
      }
      default: {
        return input;
      }
    }
  }

  return input;
}
Convert BSON into a plain string:
- { _bsontype: 'ObjectId', id: <Buffer> } => <ObjectId>
- { _bsontype: 'Binary', __id: undefined, sub_type: 4, position: 16, buffer: <Buffer> } => <UUID>
- { _bsontype: 'Binary', __id: undefined, sub_type: <number_not_4>, position: 16, buffer: <Buffer> } => <Binary>
@param {ObjectId|Binary|*} input
@returns {string}