Questions tagged [mern]

MERN stands for Mongo, Express, React and NodeJS.

Similar technology stack to , replacing with .

3381 questions
0
votes
1 answer

How update and delete bulk operation in mongodb?

I'm building a taskmanagment application, where only admin can delete user. when admin delete a user, I want to assign deleted users task to the his assignby user. { _id: new ObjectId("63bad43ee5d01d4cc13d58b2"), title: 'Test task', completed:…
0
votes
1 answer

How simultaneously find documents and get their count from mongodb using mongoose

My aim is to get books from the database on specific condition but at the same time i want to get their count as well. Below is my code. Here i have implemented pagination so i using limit() and skip() to get only required data for that particular…
Roshan Shetty
  • 267
  • 1
  • 13
0
votes
0 answers

Do we need npm package of third party API

I am implementing a signup functionality using mobile OTP authentication in my MERN application. Few questions I have related to this Do I need to install npm package of third party who provided the sendOTP API or Can I call third party SendOTP API…
0
votes
0 answers

Can't fetchdata with useEffect in a product component

hello everyone I am aking a MERN project and Im running into a peobleme. so Im using redux toolkit slice and when I try to dispatch the fetchProduct like so import React, { useEffect, useState } from "react"; import "./products.css"; import {…
Joseph
  • 11
  • 4
0
votes
1 answer

Mongoose mixed Type object array, can findOneAndUpdate

I have a controller edit card which updates the fields of cardsArray object. cardsArray is mixed type object as fileds of each card object is different so i am storing mixed.type Althought pushing new card using addCard controller works…
Praveen Lohar
  • 17
  • 1
  • 6
0
votes
0 answers

How to secure Nodejs end point api and make it private

I am trying to build a nodejs api, I am wondring how to make it only accessible by my frontend application (MERN stack). Because others can see from the console in the frontend site the address of my backend appilcation built using nodejs I tried…
0
votes
1 answer

How do I set up a btcpay server instance

I am setting up a MERN app that includes the BTCpay api but im not sure how to set it up. I got the response on how to do it but the first step was "Set up a BTCPay Server instance. You can either install BTCPay Server on your own server or use a…
0
votes
1 answer

My website gets an error/empty when I refresh after deployment, MERN STACK

This is my previous question. How can I properly use the res.sendFile for my MERN APP, I get an error every time I refresh it, it works there. What happened here is the same thing, I still get an error when I refresh to a certain site even though I…
Zurcemozz
  • 183
  • 1
  • 9
0
votes
0 answers

Is it possible to connect the BTCpay server api to my app

Is It possible for me to use the BTCpay server api within my MERN app to allow users to connect there wallets and create invoices and if say is there any tutorials or pages that I could read up on
0
votes
0 answers

NodeJS (MERN) where to sanitize and validate

I was just wondering where I should sanitize and validate my incoming data. Mongoose has some validation functions and combined with Validate.js I can do the validation there. But should I also do the sanitization there? Or is it better to do this…
0
votes
0 answers

Problem setting a cookie in a react app in production

I'm having issues setting a cookie in a react app, In development, it works but when I switch to production the cookie is not received by the browser. I'm using a node.js/express server. The backend and frontend are both hosted on vercel. This is…
0
votes
0 answers

How to display my pygame project on a web page?

I am making a a personal portfolio web page where I want to display my projects but I'm not sure how to make the GUI screen appear on a webpage. I built a little puzzle game on pygame for my 1st sem project n I'd like that to appear on my webpage as…
0
votes
0 answers

Verify if yup field has a value that exists in a predefined array of values

I am using Yup for form data validation along with Formik. This is a yup schema for one of my react forms. const values=['All','Subscribers'] export const newsLetterSchema = yup.object().shape({ audience: yup.string(), subject:…
Roshan Shetty
  • 267
  • 1
  • 13
0
votes
0 answers

SOLVED: Pass data between pages in mern stack

So i have a mern project. The dashboard page on my website is fetching "project" documents from the db and using the map() function displaying the data and an open project button. When a user presses on one of those "open project" buttons, i want to…
0
votes
0 answers

How to define roles and responsibilities in MongoDB other than ADMIN

As i am new to mongodb, I am doing a project of pharmacy management system in node and mongoDB. I want to make a table ROLE in which i only state id and ROLE attribute {can be admin, can be customer}, and a table of user -> having attributes {id,…