Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

612
Vistas
ParallelSaveError: Can't save() the same doc multiple times in parallel

I moved my local db to mLab's free tier and I'm getting an error I didn't get before. ParallelSaveError: Can't save() the same doc multiple times in parallel

The error is catching from line user.save(). Could you take a look and please show how to fix it? I'm so lost...

// Confirm password.
// Execs after requiresAuth permission resolver.
const confirmPassword = ({ user, inputs: { password } }) => {
  // Validate args.
  validate([required, isLength], 'PASSWORD', password)

  // Required for graphql. Expects a promise.
  return new Promise((resolve, reject) =>
    user.comparePassword(password, (err, isMatch) => {
      if (err) return reject(err)
      if (!isMatch) return reject(error('CONFIRM_PASSWORD_FAILED'))
      return resolve(user)
    })
  )
}

// Compare submitted plain text password with the salted and hashed version.
    UserSchema.methods.comparePassword = function(candidatePassword, callback) {
      return bcrypt.compare(candidatePassword, this.password, (err, isMatch) => {
        if (isMatch) {
          this.account.authStrikes = 0
          this.account.lastConfirm = Date.now()
        } else {
          this.account.authStrikes += 1
          if (this.account.authStrikes === 3) {
            this.account.status = 'locked'
            require('../resolvers/auth')
              .createUnlockAccountToken({ userId: this._id })
          }
        }
        return this.save()
          .then(() => callback(null, isMatch))
          .catch(err => callback(err))
      })
    }
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda