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}} {{texto}} {{else}} {{/each}} To create the modell and the collection, I used: var conexao = require("../config/conexao") var CategoriaSchema = conexao.Schema({ nome:{ type: String, require: true }, slug:{ type: String, require: true }, date:{ type: Date, default: Date.now() } }) 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) => { (colsole.log(erro)) res.redirect("/cadastrar") }) }) Can anybody help me?
No error appears on the console, but when loading the screen, only the title "Category Listing" appears and it does not list the categories.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)