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

247
Views
How can a find() access a document field for an operation? (MongoDB, nodeJS)

hello I would like to know if daily_price > = price_clic * number_view

Model.find({

 daily_price: { 

  $gte: price_clic * number_view

 }

})

const schema = mongoose.Schema({

  price_clic: { type: Number, required: true },
  number_view: { type: Number, required: true, default: 0 },
  daily_price: { type: Number, default: 0 },

})

thank you so much

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The following code solved my problem:

 $expr: { $gte: [ "$daily_price", { $multiply: ["$price_clic", "$number_view"] }, ], },
over 4 years ago · Santiago Trujillo 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!