Questions tagged [mongodb-4.0]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Application can't connect to MongoDB server through IP address

I have a java application that connects to mongoDB 4.0.2 replicaSet with one node (Primary). I upgraded the database to mongoDB 4.2.20. Even though, after making tests I decided to downgrade to 4.0.2. ...
0 votes
0 answers
6 views

Run mongoimport in a complete isolation

We planning our data migration from one standalone server to other standalone server. (we can't use replication due to some constraint) We had used fsyncLock() and fsyncUnlock() to ensure complete ...
  • 155
-1 votes
1 answer
20 views

How to store data in two separate mongo db server

I have application which uses mongo db currently I have one instances of mongo db server in my first data center in my another data center I have second mongo db instances what I want to archive is ...
1 vote
1 answer
95 views

How to update mongodb configure at Docker?

I am unable to enable security parameter at docker of mongodb at mongod.conf file. So how can I configure any parameter at mongod.conf file? I found a file inside mongodb container named it as mongod....
0 votes
0 answers
51 views

Restore Mongo DB backup

I have mongodb backup files as in.wt and.bson and some wieldtrigger files. I have installed mongodb on a new server and copied backed up files to /var/lib/mongo folder and restarted the mongodb ...
  • 1
0 votes
0 answers
16 views

How to monitor on prem mongodb cache-misses with prometheus in kubernetes

Using mongodb 4.0.x, we are running as a statefulset in an EKS cluster. We need to monitor it such that we want to know when a potential customer impacting issue may occur. We're already monitoring ...
  • 103
0 votes
1 answer
481 views

Do I need to split a 1.5 billion document database into several in a standalone MongoDB?

There will be total 1.5 billion documents in nearly 100 collections in one database. Need I to separate this database into several? Is there a performance limitation for a single database when the ...
0 votes
0 answers
79 views

Older version of Mongo compass gives exact collection while new one does not

On version 1.29.4 of Mongo Compass I am presented with a document count of collections as soon as I click on a DB along with other overall stats. But on version 1.30.1 I only get a figure like 30 M or ...
  • 329
0 votes
1 answer
315 views

Update data type from integer to decimal128 for all document having nest array in mongo db

Had a JSON structure which is having nested array and need to update all data type for that json structure [ { student: [ { name: { firstName: "Rahul", ...
0 votes
1 answer
419 views

update datatype field int to decimal128 in mongo db in nested json structure

Hi have tried to updated nested field datatype db.test.find().forEach(function(data){ data.age = NumberDecimal(data.age); data.phone.$.mob = NumberDecimal(data.phone.$.mob); db.test.updateOne({_id:...
0 votes
1 answer
393 views

question on mongodb oplog usage

One of my secondary on a PSS replica set (v4.0.4) always goes out of sync after it tries to rollback automatically after local.oplog.rs collection cleans up on the secondary. Question Though I've ...
0 votes
1 answer
126 views

In MongoDB ReplicaSet, does a priority 0 node (hidden, delayed, etc) have to have the same Oplog size as the nodes that can become primary?

I understand the Oplog collection in MongoDB replica set. A bigger Oplog means a bigger recovery window when a data bearing node goes down. However for nodes that can never be primary, is the Oplog ...
  • 101
-1 votes
1 answer
440 views

find a problem into mongodb cpu usage in mongodb atlass

Since a few days ago, resource usage of the database has increased a lot when we don't have a new query is added to the system I am asking for help on how to solve the problem And, I received the ...
1 vote
2 answers
2k views

how to disable access to mongo shell to anonymous users?

i have created users in mongodb . one user among them is admin. but when i do $mongo it is allowing me to connect to mongo shell with out me specifiying user and password. what should i do to prevent ...
0 votes
1 answer
6k views

mongod.service: Failed with result 'exit-code'

I'm trying to run mongodb server : sudo systemctl start mongod this gives me no error, but when I try to check the status, I get error saying : mua@mua  ~  sudo systemctl status mongod ...
1 vote
2 answers
1k views

"[ftdc] serverStatus was very slow" - MongoDB 4.0.4

I'm seeing very frequent messages like this in mongod.log and doesn't give an exact reason for the server status was very slow. looks like ftdc logs more information but interpreting ftdc log is very ...
  • 94
0 votes
1 answer
845 views

Standalone Mongodb suddenly failed and I'm unable to recover. Backups are also corrupt

Running on FreeBSD/ZFS for several months, users reported trouble. At this point I'm out of options so any help is apreciated. The database backs a Node.js based authoring tool with a couple of users, ...
0 votes
2 answers
147 views

Unable to start mongod daemon after upgrading OS from Ubuntu 16 to 18

Unable to start mongod daemon after upgrading OS from Ubuntu 16 to 18 root@dummy2:~# mongod --version db version v4.0.4 git version: f288a3bdf201007f3693c58e140056adf8b04839 OpenSSL ...
  • 94
0 votes
0 answers
34 views

Why does the size of fields in a collection in mongodb database affect query performance?

I had a collection that was growing and with it's growth had a crazy increase in query response times. The collection records looked something like this: { orderStat: { type: String }, items:...
  • 125
0 votes
0 answers
125 views

My Mongos can't authenticate to my replica set

I have 3 config servers in a replica set and when I use the command: sudo mongos --configdb crs/the 3 config servers:port# --keyfile "Keyfile", I keep getting this error: [mongosMain] Unable ...
0 votes
1 answer
538 views

mongodump failing to connection replica set

I'm able to connect to secondary node from arbiter node of the replica set. mongo -u backup02 -p backup02_password --port 8133 --host p1dummy:8133,p2dummy:8133,drdummy:8133 --authenticationDatabase ...
  • 94
0 votes
1 answer
257 views

what will happen if MongoDB primary host is down and secondary is out of sync. will we lose transaction?

In our environment, we have one primary(A) and two secondaries(B & C nodes) running in Mongodb 4.0 version. secondary(C) server is newly added and sync is happening on that. Cluster is running ...
0 votes
1 answer
177 views

Do you think using ObjectID as field name is a bad practice? What can go wrong if I follow this design?

I design a MongoDB collection where I am planning to use mongo ObjectID as a field name. The ObjectID is a PostID and in the array, I track all the userID who liked or disliked the post.
  • 1
0 votes
1 answer
130 views

Unable to start mongod daemon and it looks its crashing

DummyD3 is node3 of 3 node replication cluster. DummyD2 is primary and DummyD1 is Secondary (which is in sync with primary). I tried deleting the data under data path and did rsync from other ...
  • 94
0 votes
1 answer
114 views

queryHash field not available in mongos slow query logs

Mongodb V4.2 has introduced queryHash in slow query logs to identify slow queries with same query shape. While this queryHash is available in slow query logs in mongod logs (shard server), it is not ...
  • 143
2 votes
0 answers
197 views

shard migration failed with aborted at system.config.sessions collection!

A month ago, I have upgraded my mongodb cluster to version 4.4.1 from 3.6. Then recently mongodb shard migration failed with error 'aborted' as follows: balancer: Currently enabled: yes ...
2 votes
1 answer
1k views

Read Concern Majority when majority nodes are down

I have a 6 node replica set (all of them data bearing) with 5 voting members. If I lose 3 voting members, I will not have a majority voting members and my replica set will become read-only. In this ...
0 votes
1 answer
40 views

How many cluster must i created on MongoDB Atlas?

I want to implement MongoDB transactional. But there is a term that must not single alone server. So, how many clusters must I create to an implement that?
  • 3
1 vote
1 answer
60 views

MongoDB: Queries running twice slow on NEW server compared to OLD server

I transferred current/old running DB into a new standalone server for MongoDB. To do this, I performed the following: Took dump of data from OLD server Restored data from the generated dump into NEW ...
1 vote
0 answers
603 views

Upsert unique index Mongodb?

I've written ETL in MongoDB which processes data from multiple collections and insert the processed data in new collection. While inserting processed data to new collection, I get Duplicate key Error ...
3 votes
2 answers
602 views

mongodb removeShard issue with config.system.session

I have a staging mongodb 4.0.19 sharded cluster with 2 replica set shards . I want to remove one shard. I followed the documentation: https://docs.mongodb.com/v4.0/tutorial/remove-shards-from-cluster/...
1 vote
2 answers
4k views

Mongoose is not showing the ISODate in the result

I am using mongodb version 4.2.2. I have following data: { "_id" : ObjectId("5f0c58089c058304f7a64fa9"), "date" : ISODate("2021-07-11T00:00:00.000Z"), ...
0 votes
1 answer
1k views

MongoDB dump oplog based on timestamp

I'm trying to dump oplog.rs from local database, based on timestamp. Query directly from mongo shell works but not from mongodump Query from mongo shell RS1:PRIMARY> db.oplog.rs.find({"ts" : {$gt ...
  • 15
0 votes
1 answer
60 views

Error configuring mongodb replicaset with inmemory

I'm trying to configure a MongoDB replicaset with 3 replicas. The primary and another use the in memory storage engine, and the third uses wired tiger. I am using this configuration. When I restart ...
0 votes
0 answers
133 views

MongoDB works only on user is assigned to admin database

I am using mongo db with authentication and it is working as expected when I map the user to the admin database like below, use admin; db.getUsers(); { "_id" : "admin.test1", ...
  • 71
0 votes
1 answer
32 views

MongoDB Reconnects to Secondaries Too Fast

How can MongoDB 4.0.12 be configured to SLOW its rate of re-connecting to its replica members when they are down? I had MongoDB replica members die. The online replica members get “connection refused”...
0 votes
2 answers
3k views

mongodb conf node won't start - compatibility error

I recently upgraded a dev sharded-cluster from 3.6 to 4.0 - one of the conf servers is now failing to start: 2020-01-30T13:19:02.972-0600 F CONTROL [initandlisten] ** IMPORTANT: UPGRADE PROBLEM:...
0 votes
1 answer
868 views

How to use mongoexport command with ssl?

I am trying to export collection data from (SSL MongoDB 4.x), for this I am running below command on linux terminal. Earlier I used mongoexport command in Linux terminal without SSL which works ...
  • 101
1 vote
1 answer
28 views

How to get only those docs which has all the match fields in mongoose

Let say I have the following collection named survey: { _id: 1, results: [ { product: "abc", active: true}, { product: "xyz", active: true} ] } { _id: 2, results: [ { product: "abc", active: false }, ...
2 votes
1 answer
714 views

Why does MongoDB 4.0 require journaling for replica set members using WiredTiger?

This is a very interesting change in version 4.0 since checkpoints seem to serve a very similar role to journaling. The checkpoint ensures that the data files are consistent up to and including the ...
  • 165
0 votes
1 answer
273 views

Ranged Sharding - Logic behind forming ranges for hexadecimal string

I have a sharded collection where the shard key is a field called "uuid". This field's value is of type string and represents hexadecimal values i.e a hexadecimal string. For each document this "uuid" ...
  • 103
2 votes
0 answers
786 views

MongoDB Chunk Migration fails with "error 'aborted'"

I have a simple setup: 2 Mongos 3 Shards, deployed as a Replica Set 3 Config Servers, deployed as a Replica Set Each replica set consists of 1 Primary, 1 Secondary and 1 Arbiter. (Except the Config ...
  • 121
0 votes
1 answer
3k views

Filter based on values after join operation - MongoDB

I have two collections in the following format - collection1: { "_id": "col1id1", "name": "col1doc1", "properties": [ "<_id1>", "<_id2>", "<_id3>"] } collection2: { ...
-1 votes
1 answer
34 views

Trouble designing mongodb 1-many collection/query that could grow without bounds

So in an application I'm currently working on, I'm having an issue designing a collection. I can't give away too much information about the application, but here is a similar (albeit not as realistic) ...
1 vote
0 answers
62 views

What will be the behavior of mongodb under this partial network partition

Consider a shard cluster: Has only one shard, but the shard has 3 replicas A, B, C Has 3 mongos instances mongos and mongod instance are running across 3 different data centers. The primary node (A) ...
0 votes
1 answer
207 views

How to get the last 10 query run on MongoDB?

I am using mongoose driver in my Node.js app and I want to know what queries mongoose run behind the scene when I call available function on mongoose model. e.g. I am saving a signup information for ...
0 votes
1 answer
322 views

mongorestore - documents fail validation

The similar question already have been asked: How to validate a mongorestore But how to actually validate the documents in mongodumb and mongorestore? And also - can I see the documents that fail ...
  • 101
0 votes
1 answer
341 views

Why is MongoDB user with the only privilege as "find" able to insert and update collection?

I want my user to have only find action privilege on a specific collection. However, when I create the user with the privilege, restart the mongod server and run the mongo shell again with -u -p and --...
1 vote
0 answers
208 views

MongoDB slow search in array with $all multiple conditions, even with index

I have a mongodb collection with about 100.000 documents. Each document has an array with about 20 elements. The array looks like this: features: [ "0_Toyota", "29776_Grey", "...
  • 11
8 votes
1 answer
1k views

How can I reduce time spent acquiring the mongodb schema lock?

We have a mongodb 4.0.10 cluster, backed by WiredTiger, in production, with a 3 node replica set consisting of a master and two slaves. One of the slaves has another service co-located that queries ...
  • 83