Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
¿Por qué la mangosta cambia de variable?

Parece que mangosta (5.6.11) está cambiando mi valor en una consulta. ¿Esto es normal? ¿Hay alguna manera de mantener el caso de cadena igual?

 console.log('>>',req.body.visitor) Visitor.findOne({ email: req.body.visitor.email }).then((visitor)=>{ ....

consola/registro del servidor:

 >> { email: 'Maida_VonRueden@hotmail.com',//this is a fake email generated with faker enteredValidationCode: '969621' } Mongoose: visitors.findOne({ email: 'maida_vonrueden@hotmail.com' }, { projection: {} }) // ^ Why does the email change here?

¿Tengo que usar expresiones regulares para consultar mayúsculas y minúsculas ( Visitor.findOne({email: {$regex: new RegExp(req.body.visitor.email, 'i')}}) )?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Basado en el comentario de @AKX, mi esquema requería minúsculas

 email: { type: String, unique: true, lowercase: true, // < HERE required: [true, 'cant be blank'], match: [/\S+@\S+\.\S+/, 'is invalid'], index: true }

pordocumento

booleano, si llamar siempre a .toLowerCase() en el valor

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!