Skip to main content

All Questions

Tagged with
0 votes
0 answers
18 views

New user not being registered in mongodb from nodejs and express

I have developed an API using Node.js to facilitate user creation and management. Each user is granted the privilege to book visits to properties within the system. While user registration and ...
Syed Laeeq Ahmed's user avatar
0 votes
0 answers
20 views

Why my query is not executed properly in postman but when I used that query in MongoDB compass it will work fine

{members: { $in: [user] } } i am tring tring to execute this query in my project, postman show no data and in mongodb campass it is showing 1 doc and that it i want. the req.query is equal to this ...
Kashaf Dawood's user avatar
1 vote
1 answer
38 views

How to have mongoDB populate subfields of transactions collection, for the sender and receiver, based on their _ids provided from the users collection

Here's my Mongoose Schema for the three collections users, accounts and transactions respectively: const userSchema = new mongoose.Schema({ username: { type: String, required: true,...
user24956669's user avatar
0 votes
0 answers
49 views

MongoServerError: E11000 duplicate key error when trying to add a video to a playlist in MongoDB

I'm working on a MERN stack application where I have a Playlist document in MongoDB that looks like this: { _id: new ObjectId('663296c9ca082f17ba715a4c'), name: 'My Fav 02', videos: [ new ...
Biswas Prasana Swain's user avatar
0 votes
1 answer
101 views

the transactions are not rolling back in mongodb

var mongo = require("mongoose") session10 = await mongo.startSession try { await session10.withTransaction(async () => { console.log("transaction ...
Xxxxx's user avatar
  • 1
0 votes
1 answer
296 views

Implementing a Notification System with MongoDB, Mongoose, and Express.js for Admin Dashboard

I am working on an admin dashboard with over 100,000 users. I am looking to implement a notification system using MongoDB, Mongoose, and Express.js. The goal is to have the option to send a message ...
Nightcrawler's user avatar
  • 1,061
1 vote
1 answer
95 views

I need to fetch records grouped datewise(dates) ,daywise(monday,tuesday,....sunday) and hourwise(1,2,3...23,24) in mongodb

Below is the format of mongo table records { _id: ObjectId("656efc1366c7dce6da3185e3"), a: '656e5e0c6c773c4374b0b14a', b: '656e5e346c773c4374b0b14b', c: 'abc', d: '...
MDL's user avatar
  • 29
0 votes
1 answer
74 views

Express.js Route Returns Null Value for Database Query Using _id Field

I have the following Express.js route router.post('/', async (req, res) => { try { console.log(`Request Body :\n${req.body}`); const {orderIDs} = req.body; console....
YKM's user avatar
  • 43
0 votes
0 answers
44 views

Mongodb delay to provide data by vercel API

I create simple CRUD project with Reactjs. For server side, I use express and vercel for deploy the server codes. I use Mongodb for database. In mongodb I create a database and create 2 collection for ...
Md Tanvir Parvej badhon's user avatar
0 votes
1 answer
144 views

Optimizing MongoDB Query Speed in Node.js

I have a MongoDB query in my Node.js application that I would like to optimize for better performance. The query looks like this: var ReceiveEmailHistoryData1 = await ReceiveEmailHistory.find({ ...
Jayesh Rana's user avatar
-1 votes
2 answers
59 views

How can i group millions documnets based on interval using mongoDB

I have Millions of documents in the mongodb collection. I want to group the documents based on minute and hour interval. I created the index for timestamp. I tried below mentioned query, but it's took ...
PerumalSamy's user avatar
0 votes
0 answers
50 views

How do I write a mongoDB query to update an array of objects in a collection?

I have a cart collection that has two fields, userId and products (which is an array of all the products associated with a user). How do I query each of the product in the products array to update its ...
Gospel Amanze's user avatar
0 votes
0 answers
28 views

How can I restrict search field to return only services and orders belonging to the same user logged in?

I have a search route and wish to restrict results to only return services and orders belonging the company logged in Another issue is the return results for the orders is empty although there are ...
Esraa Esmaiel's user avatar
0 votes
0 answers
43 views

experiencing an error while connecting to server

when i start my backend program, it shows following errors in the terminal MongoServerError: bad auth : authentication failed at Connection.onMessage (C:\Users\HOME\Desktop\e 23\cinebaba\cinebaba-...
JANAKRIPAN c's user avatar
0 votes
0 answers
21 views

How to add data to nested arrays based on recursive schemas in mongoose

I have a recursive schema like this: export const SecretCommentSchema = new mongoose.Schema({ }) SecretCommentSchema.add({ _id: { type: mongoose.Types.ObjectId, required: true, default: new ...
Eddie Williams's user avatar

15 30 50 per page
1
2 3 4 5
19