All Questions
13,347
questions
-1
votes
0
answers
19
views
ObjectId() gets depreciated
whenever I am using new mongoose.Types.ObjectId(id) object id gets depreciated and I am getting this - The signature '(inputId: number): ObjectId' of 'ObjectId' is deprecated.ts(6387)
bson.d.ts(1247, ...
-3
votes
0
answers
19
views
How do i fetch data and display in MERN? [closed]
What are the steps to be followed? What are the packages that need to be installed? I am also willing to share my codes if needed.
I tried using Axios and Cors.
This is my JSX code.
import { useEffect,...
-2
votes
0
answers
8
views
How to Create Separate MongoDB Databases for Each Admin User and Manage Connection Strings in a MERN Stack Application [closed]
I am currently working on an inventory management system using the MERN stack (MongoDB, Express.js, React.js, Node.js). I have a requirement to create a separate MongoDB database for each admin user ...
-2
votes
0
answers
18
views
Problem with Data fetching MERN and showing it on frontend screen [closed]
I was following along this tutorial to get started with MERN and have not been able to get over a problem that I'm facing.
[https://youtu.be/MEab_a19ZGk?si=lQEatLzCPJFlkMiE]
This is the video I've ...
0
votes
1
answer
21
views
Mongoose connection drops at all endpoints
I’ve been working on a project intermittently for some time now. Recently, after transitioning to a new computer, and router none of my endpoints respond
I’ve taken several troubleshooting steps ...
0
votes
0
answers
23
views
http delete request to mongodb returned no message [closed]
const express = require('express');
const router = express.Router();
const { client} = require('./db');
const { ObjectId } = require('mongodb');
router.delete('/:id', async(req,res)=&...
1
vote
1
answer
49
views
Handling Form Data and User Registration in MERN Stack: Issues with FormData and Validation
I am working on a MERN stack application and I'm having trouble registering a new user. I have a form on the frontend that collects user data and sends it to the backend. The form data includes fields ...
-1
votes
0
answers
37
views
Parameter \"obj\" to Document() must be an object, got \"\" (type string)
I have a problem, in Postman, the result of the request is this:
This is my Model:
const mongoose = require("mongoose");
const mongoosePaginate = require("mongoose-paginate-v2");
...
-1
votes
0
answers
27
views
Data not Saved In MongoDb
I'm having trouble inserting a purchased course by its course ID into the user's document in the MongoDB collection using Express.js and Mongoose. The insertion does not seem to be happening correctly,...
-3
votes
0
answers
42
views
how to update many records at once in mongodb
i'm using expressjs and mongodb to update an order
const updateOrder = async (req, res) => {
const { id } = req.params;
await Order.updateOne({ _id: id }, req.body);
res.status(200).json({
...
-1
votes
1
answer
52
views
Store object array of product size and colors in mongo DB
I need to store object array of product size and colors.
Is it possible in mongo DB.(Because in ms sql it is not allowed).If so how the schema should be?.Sample object structure is shown below
{
color ...
0
votes
1
answer
18
views
Login Redirection Issue in Express.js with Passport Authentication
I am developing an Express.js application and facing a persistent issue with user authentication. Despite successful user registration and confirmed entries in the database, the login process does not ...
0
votes
1
answer
53
views
Query MongoDB documents for a particular date range [duplicate]
I am trying to query documents based on particular date range. So I need all the documents where the createdDate is less than equal to current date and greater than equal to currentDate - 2.
I am ...
1
vote
0
answers
45
views
MERN backend not working on other computers after deploying
I deployed my MERN stack app on Render. It's a flight management app and when I go to the website on my computer, I'm able to add new flight information and it displays it on the homepage. When I open ...
0
votes
1
answer
39
views
Session Not Stored In Express
I am creating a React app with Express as the backend and using MongoStore to store the session data. When I log in to Cloud Mongo in Atlas, I can see a session being created and my variable is stored....