Questions tagged [mongodb-4.0]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 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
0answers
9 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
33 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 ...
1
vote
1answer
41 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
68 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
40 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
0answers
28 views

MongoDb write performance degradation when increasing the number of concurrent writers

I was testing MongoDb write performance and noticed the following behaviour: when I increase the number of concurrent writers, the average time needed to write a document increases as well and ...
0
votes
1answer
25 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
31 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
0answers
18 views

MongoDB ChangeStream causes replica set members to run out of memory

We have 3 members of 1 replica set and we are using node.js driver and a wathcer implemented like this: const offerTreeTask = me.mdb.collection('offer_tree'); const offerTreeChangeStream = ...
0
votes
1answer
22 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
1k 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
159 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
16 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 }, ...
0
votes
0answers
109 views

Correct MongoDb connection pool strategy

I am not using any sort of ORM just the mongo node.js driver in express. Currently I wrap every request in a promise that creates a new mongo client and closes the connection when the promise either ...
0
votes
0answers
115 views

How to $lookup embedded documents in MongoDB aggregation pipeline?

I have 3 collections each related to the other. Let's assume that first collection is University: { _id: ObjectId(), name: '', description: '', creation_date: '', address: '' } And Teacher ...
0
votes
1answer
186 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
71 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
217 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
0answers
278 views

Mongo DB : Attempting to initiate a replica set with name rs1, but command line reports rs1; rejecting

MongoDB Enterprise > rep_cfg = { _id : "rs1", members : [ {_id:0, host:"Server1:27007", priority:2}, {_id:1, host:"Server2:27007", priority:1}, {_id:2, host:"Server3:...
0
votes
1answer
105 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
24 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
23 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
39 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
73 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
39 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
79 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", "...
4
votes
1answer
304 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
19 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
43 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
5k 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
193 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
582 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
131 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
95 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
380 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
2k 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,"...
0
votes
1answer
363 views

High CPU usage on fresh new install of MongoDB

I read a lot of post about high CPU usage of Mongo but almost all relates to queries. I just did a fresh install of MongoDB 4. I have no other databases than the default one. As soon as I start the ...
0
votes
1answer
145 views

MongoDB stuck in startup2 state

I have a Mongo replica set (MongoDB server version: 4.0.3) with primiry, secondary and arbiter. Size of database is about 7 Tb. I add a member to replica set. It stucks in sturtup2 mode for a month! ...
0
votes
1answer
657 views

Can i use a custom function with UpdateOne or UpdateMany in MongoDB Shell?

I wish to perform update on my database using Update command. the data structure is as following: { "_id" : ObjectId("5d06285570de7d11606275f8"), ... ... ... "ProfilePictures" : ...
1
vote
2answers
593 views

MongoDB replica set quorum config (network partitioning behaviour)

I use mongodb 4.0.10. I want to establish a quorum for a cluster of one primary node and two secondary nodes as written here. When the number of nodes is less than the quorum, 3 nodes in my case, ...
0
votes
1answer
545 views

Is mongodb upsert the right option for write intensive use case?

I'm designing a data model for a transactional use case which is write intensive. The write load would be 900 - 1,600 Transactions Per Second (TPS) which would account for 30 million Inserts/Updates ...
1
vote
1answer
3k views

can't update user password on Mongodb 4.0.5 (Use of SCRAM-SHA-256 requires undigested passwords)

I'm trying to update a password from a user, using changeUserPassword(), and I just receive the following message: Error: Updating user failed: Use of SCRAM-SHA-256 requires undigested passwords &...
0
votes
0answers
823 views

Mongodb return Error : $cursor stage :: caused by :: operation was interrupted

In recently, i meet a problem with mongodb. After i surveyed on google, there is no good result unfortunately. So i really wish anyone could answer it. As title, there is a kind of error message in ...
0
votes
1answer
93 views

mongoDB: Limit user to find documents only by ObjectId

I'm using mongoDB version 4.0.9 for various things. One of them is storing and retrieving files in mongoDB via GridFS. For that purpose, I have created a role/user in mongo with the privileges "...
-2
votes
1answer
309 views

MongoDB failed to start after adding keyFile config

I have issue with mongod service after adding keyFile in config. I follow instruction from here : https://docs.mongodb.com/manual/tutorial/deploy-replica-set-with-keyfile-access-control/ after adding ...
1
vote
1answer
5k views

How to connect to Mongodb Atlas from command line

I am currently taking the m220 lecture for javascript developer, and i am having issues connecting with my Atlas sandbox, I get the following output when I try to connect. my connection string is in ...
1
vote
1answer
364 views

Connect mongodb 4.0 with robomongo

I am facing an issue with the mongodb 4.0. I have setup mongodb on remote server and want to connect it with robo3t. But getting the below error. And here is my mongodb.conf file # mongod.conf # ...
0
votes
1answer
542 views

Is MongoDB index creation single threaded?

I have rather big dataset - 2TB of text data, 18.000 millions of lines. Each document is same: 5 fields: 4 strings + 1 integer. All fields should be indexed and searched by. That is: array of 3 ...
2
votes
2answers
948 views

Mongodb consumes too much RAM during replica resync

I have a mongodb cluster with 2 data nodes and 1 arbiter. I use mongodb 4.0.7 for all my centos VMs. A few days ago one of my servers (lets call it data-2) had a fatal crash and requested a complete ...