Questions tagged [mongodb-4.0]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
1answer
29 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 ...
0
votes
2answers
130 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
1answer
1k 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 ...
0
votes
2answers
236 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 ...
0
votes
1answer
170 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
2answers
32 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 ...
0
votes
0answers
20 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:...
0
votes
0answers
11 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
1answer
132 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 ...
0
votes
1answer
41 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
1answer
46 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.
0
votes
1answer
73 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 ...
0
votes
0answers
25 views

Listening to mongodb change streams for indexing to elasticsearch

We have a mongodb 4.0 replica set deployment with a collection that stores social media posts. This table sees a lot activity with updates amounting up to 1000 requests per second occasionally. We ...
0
votes
0answers
77 views

MongoDB concurrent update to same document is not behaving atomic

Currently, we have an orderId for which we give the benefit(posting) to the user. There are multiple events that can trigger benefit/posting. But the condition is that only 1 event should be triggered....
0
votes
1answer
42 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 ...
1
vote
0answers
82 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 ...
0
votes
1answer
126 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
1answer
19 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?
0
votes
0answers
14 views

Replace mongodb binaries all at once?

While upgrading mongodb from 3.2 to 4.4 replica set. Do I need to download and replace the binaries of all the version from 3.2 to 4.4 all at once and then restart the mongod at the end or I have to ...
1
vote
1answer
29 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
0answers
247 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 ...
2
votes
2answers
255 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
2answers
1k 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
1answer
447 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 ...
0
votes
1answer
35 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
0answers
65 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", ...
0
votes
1answer
24 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
1answer
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:...
0
votes
1answer
385 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 ...
1
vote
1answer
19 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
1answer
376 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 ...
0
votes
1answer
186 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" ...
2
votes
0answers
516 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 ...
0
votes
1answer
958 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
1answer
27 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
0answers
36 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
1answer
99 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
1answer
167 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 ...
0
votes
1answer
50 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
0answers
128 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", "...
8
votes
1answer
623 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 ...
2
votes
0answers
20 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. ...
0
votes
1answer
155 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/...
7
votes
3answers
7k 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: ...
2
votes
1answer
455 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 ...
-1
votes
1answer
1k views

How to store null in a double field in mongodb

My mongodb schema has a field of "double" data type. Sometimes, when there is no value for this field, mongo is storing it as 0.0 but I need it to store as null My Schema: db.createCollection("...
0
votes
0answers
510 views

Schedule a job - Mongodb - Run a view every day

how is MongoDB not able to schedule queries? I would like to know if it's possible to run a single insert every day: use Database var documents = db.Viewname.find({"modifiedOn":{"$gte": new Date(...
0
votes
0answers
192 views

swap collections in mongoDB

I receive current day transactional data which I dump into a collection called 'collA'. The data will be reportable for max of 4 days, after this the data becomes useless to me. Are the below two ...
1
vote
1answer
657 views

MongoDB Server Log to file and rsyslog

I have to forward my logs to rsyslog via UDP, but due to the volatile nature of UDP and rsyslog I would like to also log to a file. However, AFAICT MongoDB only allows one target for its logs: ...
0
votes
2answers
4k views

join two collections with group by and sum in Mongodb

i have this two collection and i want to join, after this I want to sum the value of TotalPrice each orderdate : some line of my two collections the first collection date : {"Id_Date":1,"...