175,439 questions
0 votes
1 answer
40 views
In a MongoDB transaction, are index entries updated immediately when an indexed field is modified?
I'm working with MongoDB transactions (Node.js, replica set). Inside a transaction, I update a document in a way that changes the value of a field that is covered by an index. Later in the same ...
Tooling
0 votes
2 replies
33 views
Docker and MongoDB
My mongo database is contained in a docker image. I use this command in order to run the docker container: docker run -p 127.0.0.1:27017:27017 mongo:Version and afterwards I do a mongorestore: ...
0 votes
1 answer
56 views
`Filters.eq(fieldName, value)` not actually creating `$eq` causes issues
I'm not sure if this is a MongoDB issue, an issue with the mongo-java-driver or if I'm doing something worng. The issue is that MongoDB can behave differently in case there is a $eq operator or if a {...
2 votes
2 answers
84 views
MongoDB to Oracle insert runs in reverse date order
I have Python code in which I am reading data from MongoDB and insert it into a table in Oracle database. I have removed some parts of the code (importing libraries, connecting to MongoDB and Oracle, ...
1 vote
1 answer
77 views
MongoDB Go Driver v2: How to Marshal a Nil Custom Type as BSON Null?
I’m using MongoDB GoLang Driver v2 and I want to store a custom money type in MongoDB. If the value is nil, I want the BSON document to store price: null. Example document I want: { "name":...
Tooling
0 votes
0 replies
50 views
How to convert javascript object of mongodb based query to mongodb query as parse
So I have an MEAN stack application where user types query ( or copy from mongodb compass ) in a editor and I use nodejs in backend to perform that query , So I use codemirror editor to text codes , ...
0 votes
0 answers
50 views
How to update a large number of mongodb documents in a tree structure?
I'm using mongo db with payloadcms and I have tree like structure. We have a collection called nodes. A node have children as array and a parent id. Now I want to change the node status like marking ...
0 votes
0 answers
34 views
MongoDB/Pymongo giving random ServerSelectionTimeoutError messages
We're using Tornado-based services, which fork and then create DB connections. This was all working fine until we tried upgrading to python 3.11 (from 3.8) and using pymongo 4.8.0. Now, we very ...
-3 votes
0 answers
29 views
Express.js: "Cannot set headers after they are sent to the client" error with MongoStore sessions - page renders correctly Error [ERR_HTTP_HEADERS_ERR [duplicate]
I'm getting the error Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client in my Express.js application using MongoDB session store, but the page displays correctly in ...
0 votes
0 answers
52 views
Mongoose model throws validation errors even though payload is correct — document still gets created on first error
I'm building a guest creation API using Next.js (App Router), Zod, and Mongoose. The problem: Even though my frontend validation passes and I see the full payload in the console, the server throws ...
0 votes
1 answer
43 views
MongoTimeoutException in Testcontainers Integration Test : Open Liberty app attempts to connect to Kubernetes FQDNs instead of local alias
Title - MongoTimeoutException in Testcontainers Integration Test : Open Liberty app attempts to connect to Kubernetes FQDNs instead of local alias I am writing integration tests for an Open Liberty-...
0 votes
2 answers
58 views
Can't connect to MongoDB Atlas (free tier)
I'm struggling to connect from my Rails deployment to an Atlas Cluster. This is my MONGODB_URI: mongodb+srv://JohnDoe:****@cluster0.*****.mongodb.net/XYZ_prod?retryWrites=true&w=majority The ...
2 votes
1 answer
80 views
How to reduce logging level in mongodb/mongodb-atlas-local [closed]
Problem: I'm using the mongodb/mongodb-atlas-local Docker image in our CI/CD pipeline for running tests. While the verbose logging is acceptable for local development, it becomes problematic in CI/CD ...
3 votes
1 answer
78 views
Mongodb timeseries collection can't query far far future records
Mongo can't bring records which are in far far future like 2394-10-20T16:10:23 now: 2025-11-17 Description: I have a timeseries collection in mongo and here is the command to created it: db....
Advice
1 vote
2 replies
70 views
Connecting to Mongodb from inside Docker container
I want to connect to my mongodb running on my localhost machine (dockerhost) from inside a docker container. For that I have to allow connections other than localhost. Unfortunetly when using --...