Questions tagged [mongodb-4.0]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
31 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 ...
user avatar
  • 1
0 votes
0 answers
10 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 ...
user avatar
  • 101
0 votes
1 answer
62 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 ...
user avatar
0 votes
0 answers
19 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 ...
user avatar
  • 329
0 votes
1 answer
89 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", ...
user avatar
0 votes
1 answer
97 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:...
user avatar
0 votes
1 answer
120 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 ...
user avatar
0 votes
1 answer
58 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 ...
user avatar
  • 101
-1 votes
1 answer
257 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 ...
user avatar
0 votes
2 answers
1k 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 ...
user avatar
0 votes
1 answer
5k 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 ...
user avatar
1 vote
2 answers
783 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 ...
user avatar
  • 94
0 votes
1 answer
615 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, ...
user avatar
0 votes
2 answers
101 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 ...
user avatar
  • 94
0 votes
0 answers
30 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:...
user avatar
  • 125
0 votes
0 answers
52 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 ...
user avatar
0 votes
1 answer
422 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 ...
user avatar
  • 94
0 votes
1 answer
131 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 ...
user avatar
0 votes
1 answer
81 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.
user avatar
  • 1
0 votes
1 answer
94 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 ...
user avatar
  • 94
0 votes
1 answer
79 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 ...
user avatar
  • 143
2 votes
0 answers
148 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 ...
user avatar
2 votes
1 answer
685 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 ...
user avatar
0 votes
1 answer
24 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?
user avatar
  • 3
1 vote
1 answer
40 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 ...
user avatar
1 vote
0 answers
483 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 ...
user avatar
3 votes
2 answers
452 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/...
user avatar
1 vote
2 answers
3k 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"), ...
user avatar
0 votes
1 answer
973 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 ...
user avatar
  • 15
0 votes
1 answer
50 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 ...
user avatar
0 votes
0 answers
84 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", ...
user avatar
  • 71
0 votes
1 answer
26 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”...
user avatar
0 votes
2 answers
2k 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:...
user avatar
0 votes
1 answer
709 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 ...
user avatar
  • 101
1 vote
1 answer
22 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 }, ...
user avatar
2 votes
1 answer
593 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 ...
user avatar
  • 165
0 votes
1 answer
248 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" ...
user avatar
  • 103
2 votes
0 answers
683 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 ...
user avatar
  • 121
0 votes
1 answer
2k 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: { ...
user avatar
-1 votes
1 answer
33 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) ...
user avatar
1 vote
0 answers
48 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) ...
user avatar
0 votes
1 answer
141 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 ...
user avatar
0 votes
1 answer
262 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 ...
user avatar
  • 101
0 votes
1 answer
191 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 --...
user avatar
1 vote
0 answers
191 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", "...
user avatar
  • 11
8 votes
1 answer
946 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 ...
user avatar
  • 83
2 votes
0 answers
26 views

Adding to MongoDB a new shard. How to minimize Impact on server loads

Is the possible to minimize Impact on server loads while adding to MongoDB 4.2 a new shard? I have found this recommendation. It could help but I sure should be few more thing which we can do. ...
user avatar
0 votes
1 answer
311 views

Solution for a readonly copy of a standalone MongoDB server

I store some data in many databases/collections on a standalone MongoDB server. This server is used for production. I need to access those data (or at least nightly build data, and not all databases/...
user avatar
  • 103
8 votes
3 answers
8k views

Unable to start mongodb as a service - Exception; Collection does not have UUID in KVCatalog

I have installed Mongodb 4.2 and when running sudo service mongod start|restart It does not start the server and I have the log below in mongod.log file. Exception in initAndListen: MustDowngrade: ...
user avatar
  • 183
2 votes
1 answer
781 views

How to set a correct value for wiredTiger concurrentTransactions

I have a single instance in server with 7 Processor and 15 Gb. In value default for wiredTigerConcurrentReadTransactions and wiredTigerConcurrentWriteTransactions is 128. But is value default, how to ...
user avatar