All Questions
274
questions
-3
votes
1
answer
63
views
I am building an app where I want the admin to update any user who are displayed in the admin panel
I am a beginner and got stuck in this problem. I am building an app where I want the admin to update any user who are displayed in the admin panel by clicking on the update button at the bottom of the ...
0
votes
1
answer
80
views
Unable to access a property of an object using Mongoose
Sample data:
{
"_id": "ObjectId_for_Site1",
"name": "Site 1",
"address": "123 Reeganangam",
"manager": {
"_id&...
0
votes
1
answer
87
views
express locallibrary tutorial author names missing from book list
I'm trying to build some knowledge in back end development (because I need it!) after spending a few years on front end, and after a short intro' into Basic Node and Express from the fantastic ...
0
votes
0
answers
50
views
how do I wait for data to be fetched in javascript? [duplicate]
so i am fetching data from mongodb atlas and then store it in an array, then i pass it in pug , but issue here is what i think is that pug file is rendered before data could be fetched .
here is the ...
0
votes
1
answer
37
views
Form data is not getting saved in MongoDB and it shows no error
I am new to MongoDB & NodeJS, I created a form using PUG. So when I click on submit nothing really happens, I am not getting any error and my data is also not getting saved in the database. My ...
0
votes
1
answer
45
views
Display MongoDB collection data using PUG (Error: Array Undefined)
I am trying to display the data from my "users" collection in my MongoDB but receiving an undefined error with the array.
In my user controller file, I have imported express, express.router ...
0
votes
0
answers
24
views
Why is this schema not storing the drop-down values to MongoDB?
I'm trying to store branch, year, semester and subject to the database. But it only stores the value name. I added the value name just for testing purposes to know whether my schema is storing ...
0
votes
1
answer
40
views
node js and Pug
each guide in tour.guides
.overview-box__detail
- if (guide && guide.photo)
img.overview-box__img(src=`/img/users/${guide.photo}`, alt=`${guide.name}`)
- else
...
0
votes
1
answer
36
views
Nested population returns a json type in pug template
Nested populate is resulting in a json output in pug - when I need it in normal string format.
My function is here -
function getStoryByIdInsideCommunity(req, res, next) {
const companyName= ...
0
votes
0
answers
36
views
Requested data didn't came to database and nodejs post text is not showing afterwards submitting
I requested data, but it's neither shows error nor data was added to database.
const express = require("express");
const { hostname } = require("os");
const path = require("...
0
votes
1
answer
278
views
Update HTML page on mongodb data change
I want to update the HTML/pug page of multiple users when particular data changes in my MongoDB database. A user(A) follows another user(B) (whose data is stored in a different collection). When user(...
0
votes
1
answer
34
views
How to count total number of columns in a mongodb table
So I'm wondering if it's possible to count the total of columns in a mongodb table by the use of .pug? How can I add the total number of columns automatically to a .pug file.
1
vote
2
answers
207
views
How to live update content on SSR express app
I have a fully functional social media app and an API made with Express, Pug and JavaScript which is server-side rendered.
For example, when I comment on a post the comment is added but I have to ...
0
votes
1
answer
311
views
Combining multiple models for one controller
I have these 2 controllers:
story.js
const Story = require('../models/Story');
exports.getStories = (req, res, next) => {
Story.find()
.then((stories) => {
res.render('story', {title:'...
-2
votes
1
answer
86
views
Failed to load resource: the server responded with a status of 404 (Not Found) while loading pictures from mongodb in heroku
Im having an issue with my app. It doesnt load images from my database, sometimes it loads for a couple of hours then they disappear from the app. Has anyone solved this error?enter image description ...