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

145
Views
why iam getting only one output and please tell what should i use to get both the values explain in simplest way
const addingAttribute=async (req,res)=>{
     let data = req.body
let findPublisher=await publisherModel.find({$or:[{name:'Penguin'},{name:' HarperCollin'}]}).select({_id:1})
console.log(findPublisher)
    let updateBook=await bookModel1.updateMany({publisher:arr},{$set:data},
{new:true})
console.log(updateBook)
    res.send({msg:updateBook})
    } 

For the books published by 'Penguin' and 'HarperCollins', update this key to true.

but this code is updating for only the first value this is bcoz I am a using or can u please tell me anything else

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

0

MongoDB's find returns something called a database cursor. You have to exercise the cursor's API to chase through all the values it is presenting.

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!