function _getOption(query, option, def) {
  const opts = query._optionsForExec(query.model);

  if (option in opts) {
    return opts[option];
  }
  if (option in query.model.base.options) {
    return query.model.base.options[option];
  }
  return def;
}
Get options from query opts, falling back to the base mongoose object.
@param {Query} query
@param {Object} option
@param {Any} def
@api private