Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everyone, Im tryingto to list the data coming from the mongo db in a file handlebars. But the problem is that when I load the screen, only the message "Category Listing" appears and the names of the categories do not appear as requested:

{{#each erros}}



To create the modell and the collection, I used:

var conexao = require("../config/conexao")

var CategoriaSchema = conexao.Schema({

type: String,
require: true

type: String,
require: true

type: Date,


module.exports = conexao.model("Categorias", CategoriaSchema)

And in the main file, to render the handlebars file, I used:

const express = require("express");
const handlebars = require("express-handlebars");
const app = express();
const Handlebars = require('handlebars')
const Categorias = require("./models/Categoria")

app.get("/", (req, res) =>{
    Categorias.find().then((categorias) =>{
        res.render("listaCategorias", {categorias: Categorias})
    }).catch((erro) => {

Can anybody help me?

What I have tried:

No error appears on the console, but when loading the screen, only the title "Category Listing" appears and it does not list the categories.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900