Questions tagged [mongodb-4.0]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
16 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
15 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
24 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
19 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
12 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
17 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
815 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
111 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
73 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
69 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
126 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
48 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
131 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
183 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
54 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
23 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
20 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
33 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
52 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
38 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
12 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
68 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
249 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
39 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: ...
0
votes
0answers
63 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
147 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
409 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
68 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
69 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
10 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
18 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
11 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
261 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
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
299 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
196 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
113 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
557 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
453 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
400 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
670 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
88 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 "...