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

134
Views
Aplicar filtro en fecha en mongodb

Tengo un campo llamado RechargeDate en mongo:

 "Recharge_Date" : ISODate("2022-06-13T00:00:00.000Z")

Ahora, necesito aplicarle un filtro basado en la fecha de hoy. Si la fecha de hoy es del 1 al 10 de un mes, entonces el filtro debe ser tal que cuando se aplica en la función de búsqueda de mongoose, obtenga el registro entre el 1 y el 10 del mes de Recharge_Date.

De manera similar, si la fecha de hoy es del 11 al 20 de un mes, entonces el filtro debe ser tal que cuando se aplica en la función de búsqueda de mongoose, obtiene el registro entre el 11 y el 20 del mes de Recharge_Date.

Quiero saber cómo se vería la consulta de filtro.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Puede usar moment.js o una biblioteca similar:

 db.collection.find({ Recharge_Date: { $gte: moment().startOf('day').toDate(), $lte: moment().endOf('day').toDate() } })
about 4 years ago · Santiago Gelvez 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!