Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

235
Vistas
MongoDB: find records for last X days (in strict JSON)

Finding records for last X days only can be done in mongo Shell Mode with

db.some_collection.find({"some_date":{$gte: (newDate((newDate()).getTime() - (X * 24 * 60 * 60 * 1000)))}})

My question: is there a strict JSON equivalent to this command or not?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I would much rather have this be false but it seems like there is no way to do a strict JSON search for datetime in mongo. You might want to store time as a string (unix timestamp) and then search for it like a string or use non JSON query with date object

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda