Questions tagged [mongodb-4.0]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
20 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
65 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
0answers
39 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
13 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
17 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
17 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
60 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
36 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
58 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
44 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
35 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
21 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
14 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
29 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
26 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
35 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 --...
0
votes
0answers
13 views

what to pass as a key instead of username and password for anonymous users @login?

i am trying to make a mongodb schema in which i am allowing the person to publish projects anonymously, i already have the authenticated user schema and i am thinking of using that only to allow ...
0
votes
0answers
6 views

I need to know how many connections are using mongodb when an error comes up

According with this https://stackoverflow.com/questions/7446528/mongodb-c-sharp-driver-doesnt-release-connections-then-errors it doesn't really close the connections used, there's a way to know how ...
1
vote
0answers
52 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
155 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
0answers
4 views

Different storageSize in Primary and Secondary members In ReplicaSet

Mongodb : 4.0.9 Nodes : 3 (PSA) Journal : Enable Compression : snappy The db.collection.stat() of primary and secondary are followings: Primary "size" : NumberLong("1556591318014"), "...
0
votes
1answer
34 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
2k 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: ...
0
votes
0answers
32 views

Unable to connect with MongoDB when giving mongod command in Cli

I'm trying to install mongoDb on centos VM and followed few sites like https://linuxize.com/post/how-to-install-mongodb-on-centos-7/ , https://www.digitalocean.com/community/tutorials/how-to-install-...
2
votes
1answer
78 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 ...
0
votes
1answer
129 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
25 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
34 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 ...
0
votes
0answers
9 views

Can two or more versions of MongoDB run concurrently as Windows services?

I'm working on two .Net projects which use different versions of MongoDB (3.4 and 4.0). By using separate data and log directories (as per this article) I can run both versions concurrently on demand ...
0
votes
0answers
12 views

Mongodb log rotation

Does anyone can help me on Mongodb LogRotation shell scripts rather than default one. I am looking for shell scripts to automate log rotation with specified log file size limit or everyday rotation . ...
0
votes
0answers
5 views

Mongodb SSL certificate error

The server certificate doesn’t match with hostname. The hostname doesn’t matches with SAN. It throws follow error during adding secondary for replica initiation. For example: Server certificate ...
0
votes
0answers
9 views

How to insert new document with an aditional atribute in a document with something like Datetime() from sql?

With sql server, we can insert data into another table and additionally we can insert a "date" field (or even if it's default, we don't even need to specify it in the insert query ). How can I do ...
1
vote
1answer
131 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: ...
-1
votes
2answers
1k 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
163 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
0answers
106 views

MongoDB Error Invalid access at address: 0 Got signal: 11 (Segmentation fault)

Our mongo got shutdown tonight. But We are unable to find its cause. Its showing Invalid access at address: 0 Got signal: 11 (Segmentation fault). The full backtrace as below Our Mongodb version is 4....
0
votes
1answer
91 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
393 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
266 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
0answers
39 views

Is it possible to start a standalone MongoDB server with oplog enabled (like it was possible around version 2.6)?

This old question SO question has the answer for versions 2.6 and prior, but it seems MongoDB 3.2 and up do not allow the --master flag that would start the server enabling the oplog, which would ...
0
votes
1answer
187 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 ...
0
votes
1answer
2k 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
429 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
59 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
158 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
2k 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 ...
0
votes
0answers
5 views

Not able to view the document in the sharded cluster

I have a sharded cluster of two replica sets - replSet and shardSet. Each of these clusters have one collection in it. When connecting to the sharded cluster using MONGOS, I am able to view the doc ...
1
vote
1answer
261 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
320 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 ...