validate(obj, {
    extendedCustomContext = {},
    ignore: ignoreTypes = [],
    keys: keysToValidate,
    modifier: isModifier = false,
    mongoObject,
    upsert: isUpsert = false,
  } = {}) {
    const validationErrors = doValidation({
      extendedCustomContext,
      ignoreTypes,
      isModifier,
      isUpsert,
      keysToValidate,
      mongoObject,
      obj,
      schema: this._simpleSchema,
      validationContext: this,
    });

    if (keysToValidate) {
      // We have only revalidated the listed keys, so if there
      // are any other existing errors that are NOT in the keys list,
      // we should keep these errors.
      /* eslint-disable no-restricted-syntax */
      for (const error of this._validationErrors) {
        const wasValidated = keysToValidate.some((key) => key === error.name || error.name.startsWith(`${key}.`));
        if (!wasValidated) validationErrors.push(error);
      }
      /* eslint-enable no-restricted-syntax */
    }

    this.setValidationErrors(validationErrors);

    // Return true if it was valid; otherwise, return false
    return !validationErrors.length;
  }
Validates the object against the simple schema
and sets a reactive array of error objects.
@param obj {object} the document (object) to validate
@param extendedCustomcontext {object=}
@param ignoreTypes {string[]=} list of names of ValidationError types to ignore
@param keysToValidate {string[]=} list of field names (keys) to validate. Other keys are ignored then
@param isModifier {boolean=} set to true if the document contains MongoDB modifiers
@param mongoObject {MongoObject=} MongoObject instance to generate keyInfo
@param isUpsert {boolean=} set to true if the document contains upsert modifiers
@return {boolean} true if no ValidationError was found, otherwise false