Display Mongodb collection in jade template

Viewed 4039

I'm new in node.js and mongodb. I set a mongodb collection called "article". I would like to display all the article of this collections in a jade template. I used this code :

server.js:

articles: db.article.find()

index.jade:

-for article in articles
      .row
        .twelve.columns
          .panel
            li= article.text

The jade is really basic but that will change. The fact is, when I run this code, the list in the jade template is empty and nothing is display. It looks like the variable 'articles' is empty.

Does anyone know how can I make that working?

Thanks

2 Answers
Related