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

120
Vistas
Display the most recent Object from an Array (using mongodb and ejs)
 <% blogs.forEach(blog => { %>
      <h4><%= blog.title %></h4>
      <p><%= blog.createdAt.toLocaleDateString() %></p>
      <% }) %>

I have a database I can currently access on mongodb, and I'm using express, ejs and node to access and display them on my website

the code above is from a tutorial, (https://www.youtube.com/watch?v=1NrHkjlWVhM) and it will display every 'blog' in my 'blogs' database, but I only want to display one 'blog', the most recent 'blog'.

I am fairly new to Javascript, I have some HTML and CSS knowledge.

about 4 years ago · Juan Pablo Isaza
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