title: how to pass an array of objects to jade template?
body: <p>i want to pass an array of objects from mongodb to the client...</p>
  
  <p>this is the object</p>
  
  <pre><code>var objeto_img=
                              {
                                  name:'name of the file',
                                  image:'image.jpg url',
                                  title:'title of the image',
                                  caption:'descripcion of the image',
                                  link:"#",
                              };
  </code></pre>
  
  <p>in some profiles the are many images so the is an array of objects like this</p>
  
  <pre><code>[var objeto_img=
                              {
                                  name:'name of the file',
                                  image:'image.jpg url',
                                  title:'title of the image',
                                  caption:'descripcion of the image',
                                  link:"#",
                              },var objeto_img=
                              {
                                  name:'name of the file',
                                  image:'image.jpg url',
                                  title:'title of the image',
                                  caption:'descripcion of the image',
                                  link:"#",
                              },var objeto_img=
                              {
                                  name:'name of the file',
                                  image:'image.jpg url',
                                  title:'title of the image',
                                  caption:'descripcion of the image',
                                  link:"#",
                              };]
  </code></pre>
  
  <p>this is the server code </p>
  
  <pre><code>res.render('index/perfil_publicacion_contenido',
      {
          datos:datosRecibidos
      })
  </code></pre>
  
  <p>datosRecibidos is an array of objects from mongodb</p>
  
  <p>and im trying to put in a variable inside jade </p>
  
  <pre><code>input(type='hidden',id='imagenes',value=datos.img)
  </code></pre>
  
  <p>but when i try to get the objects</p>
  
  <pre><code>var fotos=$('#imagenes1').val();
              for(foto in fotos)
              {
                  console.log(fotos[foto].image)
                  console.log(fotos[foto].name)
                  console.log(fotos[foto].caption)
                  console.log(fotos[foto].title)
              }
  </code></pre>
  
  <p>the console log print undefined</p>
  
  <p>why is that??? how can i get the information from db correctly in the client???
  tnx all</p>