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

222
Views
La consulta no muestra la identificación en el documento

Quiero mostrar un documento, pero falta el campo de identificación, aunque está en la base de datos.

 Topic.findOne({id: 31}).sort({id: -1}).limit(1) .then((topic) => { console.log(id); //null const newTopic = new Topic({ id: 32, level: level, topics: topic, phrases: [phrases1, phrases2], nouns: [nouns1, nouns2, nouns3], verbs: [verbs1, verbs2, verbs3], adjectives: [adjectives1, adjectives2, adjectives3], }); newTopic.save(); res.redirect("/admin/panel") }); //console.log output { _id: new ObjectId("620eb4d998b1747bbe24c672"), level: 4, topics: 'What is your definition of risk?', phrases: [ 'Risk is the...', "Anything that is/isn't..." ], nouns: [ 'possibility', 'change', 'probability', 'fear', 'occurrence', 'proposition' ], verbs: [ 'to perceive', 'to reject', 'to involve', 'to ruin', 'to take', 'to realize' ], adjectives: [ 'extraordinary', 'uncertaintly', 'different', 'unfavorable', '' ] },

Como puede ver en la imagen, "id" está en el documento, pero no se muestra en la consola.

ingrese la descripción de la imagen aquí

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

0

Es porque id es un getter de _id como una cadena, es por eso que no puede encontrarlo. Marque esto, debería responder a su pregunta: https://stackoverflow.com/a/15724424/4518630

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!