Questions tagged [mongodb-4.0]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 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
5 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
17 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
8 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
4 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
3 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
8 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 ...
0
votes
1answer
16 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
38 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
33 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
682 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
19 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
0answers
28 views

I am trying to run mongod --repair command. But It always fails

I am trying to run mongodb --repair command after running for a considerable amount of time it shutsdown with following logs. t.oplogTruncateAfterPoint" } 2019-07-11T20:36:14.034+0000 I INDEX [...
0
votes
1answer
42 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
53 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
1answer
76 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
15 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
29 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
334 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
123 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
18 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 "...
0
votes
1answer
173 views

Invalid access at address: 0 for Mongo v4.0.5

I am running mongo on kubernettes in statefulsets. It was working fine for weeks then all of a sudden this morning i started getting errors where mongodb was failing. I tried running: mongod --...
0
votes
1answer
54 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 ...
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
105 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
91 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
204 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 ...
0
votes
1answer
259 views

How I can copy a collection from a Mongo Cluster to another Mongo Cluster? [duplicate]

I have a collection with more than 1 TB size and wanted to move it another MongoDB cluster PS: Both clusters are sharded over 5 shards and they are on-prem infra.
1
vote
1answer
68 views

Fastest way to move Collection from Sharded MongoDB Cluster to a another Sharded MongoDB Cluster

I have to move a MongoDB Collection (Size: 1TB+) from Sharded MongoDB Cluster to another[5 shards on both clusters]. During this operation, it is assumed that the accompanying program will be offline, ...
1
vote
1answer
88 views

32GB RAM needed to work with 200.000.000 rows in MongoDB?

I've been playing with a large dataset, consisting of a few tens of billions of rows of small ascii strings. I want to count the number of occurrences of each string in the dataset, and i suspect the ...
1
vote
0answers
87 views

Mongodb secondary reads data at 100% 24/7

We have a Mongodb 4.0 database, running a replica set with 3 members. Total database size is about 800GB. All of the members are running in docker containers. Docker shows that the master container ...
0
votes
0answers
26 views

Mongodb - add new node secondary in existing replica set shard

my mongodb configuration which i am trying to add. systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log storage: dbPath: /var/lib/mongo/mongo journal: enabled: ...
0
votes
0answers
78 views

MongoDB count() query returns outdated result in mongo shell / python script

Documents in my MongoDB collection are changing status field very frequently. I can observe it using a mongoDB client (Robo 3T). Now I'd like to monitor this process using mongo shell (or python ...
1
vote
1answer
1k views

Getting error while creating a New Connection using Studio 3T for Mongo DB

I tried to create a new connection with Studio 3T for Mongo DB. I don't have a previous DB connection and this is the new one that I am trying to create it. I can't able to figure out why this is ...
0
votes
1answer
48 views

Ops Manager Install in Windows and connect to mongod instance started in linux

Can we install ops manager in windows and connect to mongodb instance started in Linux operating system? Does ops manager installation on windows require separate installation of mongoDB instance on ...
0
votes
1answer
62 views

MongoDB Indexing - What happens if I don't index all necessary fields?

Let's say I have a collection with 20 fields and a query that uses 5 of them, to find the documents I need. 3/5 of those fields are always used in the query, 1 for equality comparison, 1 for range ...
1
vote
1answer
67 views

Is mongoreplay included in the toolset with mongodb 4.0 community version for windows?

Where to find mongoreplay tool in mongodb 4.0 community version for windows? It is not in the same place as other tools - mongoexport, mongoimport, etc.
0
votes
0answers
397 views

How to Recover Mongodb database

I have transferred my mongodb database to a new computer and am having trouble opening the database. I don't get any errors, it just won't show the 'finance' database. Here is the response when I say ...
0
votes
1answer
105 views

Equivalant MongoDB query of MySQL date query with arithmetic operations

How we can perform the below given MySQL query in MongoDB preferably in MongoDB-4.0: SELECT *,ABS(TIME_TO_SEC(TIMEDIFF(now(), datefield))/3600) as hours, (field1*field2*field2+field3*(1/(ABS(...
1
vote
1answer
30 views

Get latest data for specific identifier

I have an application that (mostly) uses only the very latest data available for a certain identifier (may consist of multiple columns/keys). However, these data may be bad or implausible. In these ...
-1
votes
1answer
24 views

Mongodb restriction on update to only allow “$push” operator

Mongodb V 4.0 I want to restrict a user's role by only allowing new inserts to the collection. Either as a new document, or as an append to the document. I don't want the user to be able to update(...