Questions tagged [mongodb]

All versions of MongoDB - a scalable, high-performance, open source, document-oriented database.

Filter by
Sorted by
Tagged with
1
vote
1answer
424 views

NoSQL- automatically cache and update references to other documents as embedded

To avoid having to look up referenced documents, one practice is to embed them (e.g. https://docs.mongodb.com/manual/tutorial/model-embedded-one-to-many-relationships-between-documents/). Is there ...
1
vote
1answer
378 views

Connection string for connecting mongo database with SSL enabled

Am facing some below problem in my mongodb replication environment I have 3 replica set environment with SSL enabled and ssl mode as preferSSL 3 servers has 3 different Key file with common CA file ...
-1
votes
0answers
28 views

How can retrieve deleted mongodb database in ubuntu server?

I mistakenly uninstalled MongoDB using the commands below. Also, it's a live database with a real customer so this mistake fully ruins my project. sudo apt-get purge mongodb-org* sudo rm -r /...
0
votes
1answer
163 views

MongoDB Ops Manager

I have few questions regarding backup process in MongoDB Ops Manager 1) How backup process works ? 2) According to documentation for production do we need to have 3 dedicated servers for ...
0
votes
1answer
384 views

How to update collections and restore while doing mongorestore?

is there any way that i can update the collection and restore the same from dump created by mongodump cmd . when we do mongorestore , it directly restores from the dump , but my requireemnet is to ...
0
votes
1answer
437 views

MongoDB convert standalone mongod to sharded replica set cluster

I have a single replica set having 3 mongod instance, collection in this instance has data already. I want to convert this instance to sharded cluster. I followed Convert a Replica Set to a Sharded ...
1
vote
2answers
541 views

Why --audit commands does not work in Mongo Enterprise

I am trying to make destination for my user activity log but every time I type --auditDestination I get errormessage "unrecognized option --auditDestination", can anyone tell me what should I do? I ...
4
votes
1answer
581 views

Flask mongodb assertion 13 not authorized for query on flask_session.sessions

Need help resetting mongodb back to its original state. We have a flask app running with mongodb with authentication turned off. Running on Ubuntu with std Flask. We tried ALL sorts of combinations ...
0
votes
1answer
220 views

Find and Insert Missing data in Mongodb Collection

I want to write python3 code to check and insert missing data. My MongoDB collection documents have one field named "height" which is BTC block number. I want to traverse in a range start to the ...
0
votes
0answers
8 views

SSL peer certificate validation failed: (80092013)The revocation function was unable to check revocation because the revocation server was offline

NETWORK [conn43] SSL peer certificate validation failed: (80092013)The revocation function was unable to check revocation because the revocation server was offline. I am facing the above error ...
0
votes
1answer
367 views

how to add shard into current cluster without sharing any chunks

my current cluster sh.status() is as below: shards: { "_id" : "rsDev", "host" : "rsDev/10.60.90.224:27003,10.60.90.224:27004" } { "_id" : "rsRaw", "host" : "rsRaw/10.60.90.224:27001,10....
0
votes
0answers
20 views

Will VPS servers work 24/7? What will happen if they crash?

I like to know if I buy a VPS service and install my MongoDB server/database on it, what will happen if this server crashes? I also like to know the answer about the dedicated servers. It's hard for ...
0
votes
1answer
27 views

What are the real life uses of role based authentication control in a database?

I am new to database management. I was going through the mongodb docs for Role Based Authentication Control. I have understood how it works, but I have a few questions. How is it applied in real life ...
0
votes
1answer
16 views

We need to do encryption in transit in mongodb so which one is recommended ssl or tsl ? and what is the difference between ssl and tls? [closed]

We are using MongoDB 4.0 community version with 1 primary 2 secondary replicaset, we need to do encryption in transit so which one is recommended ssl or tsl ? and what is the difference between ssl ...
-1
votes
1answer
106 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 [...
1
vote
2answers
1k views

Why mongodb never end some connection

My mongod runs out of connections from time to time. But when I restart the instance, it becomes normal. I check the log and found some connections were created and never be ended. This cause the ...
0
votes
0answers
8 views

Mongorestore not restoring full collection and not returning an error

I know this topic is old, but I think I am having a similar problem. I have been searching from a solution all over Stackoverflow I am running a mongodump followed by a mongorestore and in 2 out of ...
2
votes
1answer
2k views

Finding or confirming absence of corrupted data in MongoDB

Background I have a directory full of .gz files that were produced by mongodump on a mongod running MongoDB 3.4.x, which I am writing into a different instance running MongoDB 3.4.2 using ...
0
votes
1answer
146 views

MongoDB - The connection is not disconnected for a long time

I am building a system that outputs information such as visit information and page transition of the user who visited the website to MongoDB, The MongoDB connection pool of the server of the web site ...
1
vote
2answers
3k views

Issue while restarting - MongoDB

I had tried to start the MongoDB service using the following command in linux machine. service mongod restart I am getting the following error Stopping mongod: ...
1
vote
1answer
4k views

Our replica set config is invalid or we are not a member of it - MongoDB

I have started the mongodb server with replica set name 'rs01' enabled on port 27001. Then started another command window to start the mongo db on the same port. The status says the 'rs0' is not a ...
0
votes
2answers
45 views

Why MongoDB needs to disable majority read concern for PSA architecture?

We have MongoDB 3.6.9 replica set, contains 3 data nodes and 2 arbiters. I noticed warning in mongodb console: 2020-01-20T11:29:04.057+0000 I REPL [replexec-0] ** WARNING: This replica set uses ...
1
vote
1answer
61 views

MongoDB: Creating index very slow

I'm currently creating an index on a mongo database and so far it has taken about 52 hours. I've worked with large(r) Mongo databases before but creating an index has never taken this long. My ...
1
vote
1answer
26 views

mongodb :: failures in bring up mongo server

I am unable to add a replica to the cluster. Steps tried: done hot backup for existing member. Copied it to new replica. Tried to start the server, it's failing with these errors: 2019-12-31T13:03:...
1
vote
0answers
27 views

MongoDB Data loss following machine PowerOff with writeConcernMajorityJournalDefault true

Background: I'm using mongodb 4.2.0 I have deployed a mongo cluster which contain 5 configs, 3 querys and 3 - shards. Each shard consist of 4 replicas and 1 arbiter. All members are set on VMs. ...
1
vote
1answer
14 views

Reset mongo cache memory for test perfomance - windows

recently i'm working on mongo db and I'm trying to check the performance of mongodb with 2 million record. I need to clear cache every time I start the test. I don't want to restart the computer/...
1
vote
1answer
927 views

How to restore Mongo DB tar.gz archive

Using the Mongo DB Atlas cloud service (MongoDB Version: 3.4.16), the below backup archive of a MongDB was generated: Cluster0-shard-0-1531635127-5b4b0df33b34b92b0f50a045.tar.gz In this file I can ...
0
votes
2answers
1k views

How to speed up MongoDB chunk moving between shards

On a MongoDB 3.6 in a replica set and WiredTiger engine we have a large collection with 7.7TB of data. We started to see severe performance issues (extreme CPU usage and slowdown of data replication) ...
0
votes
1answer
527 views

Mongod with bind_ip error “Address already in use”

I'm trying to follow the MongoDB docs tutorial on how to setup a replica set. The command example they provide has a bind_ip parameter, which is not working. If I run the command without it mongod ...
0
votes
1answer
1k views

MongoDB - Store date and optional time as a field

I'm developing a web service using MEAN stack + Mongoose, and one of the things I need to implement is storing a date as an object's field. But the thing is, the time should be optional, e.g. the user ...
0
votes
1answer
746 views

MongoDB 3.6 crashed due to invariant() failure

MongoDB crashed twice in 6 hours today due to invariant() failure. We have been using MongoDB 3.6.3 for more than a year now, but this is the first time that we saw this issue. The extract from the ...
0
votes
1answer
617 views

how to fix replica set error

I am getting this error { "ok" : 0, "errmsg" : "server is not running with --replSet" } when I run the command on windows cmd rs.initiate( { _id : "repl1", members: [ { _id : 0, host : "mongodb0....
3
votes
3answers
3k views

Getting empty folder when using mongodump to back up my MongoDB

Basically, I have a problem with using mongodump to back up my MongoDB. This is the general syntax I use in SSH: mongodump -d myDatabaseName -o ~/backups/my_backup This is the resulting message: ...
0
votes
0answers
12 views

MongoDB Embedded vs References Performance [closed]

MongoDB supports two different type of relationships (not really relationships!) Embedded and References The 1st way is not good for my situation for some reasons. but i want to know about references....
1
vote
1answer
863 views

What's the difference between DISTINCT_SCAN and IXSCAN in explain output?

In Mongo 3.4 explain("executionStats").distinct(...), for some queries the winning plan contains an IXSCAN step, and for other queries it contains an DISTINCT_SCAN step. What is the difference ...
2
votes
1answer
869 views

Merge 2 mongodb databases

Our team have hard time. Situation: API went down, all infrastructure (API + MongoDB) terminated. We restore API and mongodb (data restored from backup). After a while (let's say 1 day) we discovered ...
0
votes
1answer
500 views

mongodb crashed with the error or permission denied

Our mongodb server was running for the last two months without any error. Suddenly it crashed and below is the log. 2017-08-11T13:41:41.320+0100 E STORAGE [thread1] WiredTiger (13) [1502455301:...
1
vote
1answer
225 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, ...
0
votes
1answer
88 views

Slow performance of query with $and & $or operators

My query with $and, $or operators is performing poorly. Even though I've built a compound index on all three fields that are specified in my query criteria, the query does a complete collection scan. ...
0
votes
1answer
339 views

mongo2.6 local file size on secondary is much larger than primary

I set up a new standalone mongo2.6 and copy one folder(database) from another machine to its data path. (cause I enabled directoryperdb) Then I set up another machine to make them as a replica set. ...
0
votes
0answers
12 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
1answer
11 views

502 error after restarting mongo db in remote server using fork command

I was trying to upgrade mongo 3.4.20 to 4.0.14 , but it lead to the system crash, so i tried reverting it back to 3.4.20. But after doing db restart using fork , there 502 error. Please help.I tried ...
0
votes
0answers
20 views

MongoDB generated ObjectID for arrays is descending instead of ascending

I have the following document in a collection in my MongoDB database: "_id":"5e2088563824e72ea5ee7095", "image":"xxx", "questions":[ { "_id":"5e2088563824e72ea5ee70c3", "text":"...
4
votes
1answer
620 views

Why does restarting MongoDB 3.0.x boost performance?

I have a MongoDB in my Development environment running on Windows, the server has 64GB of RAM, but MongoDB has only consumed 26.9GB (here we are building the database), so it should be able to hold ...
0
votes
0answers
49 views

Cascading One-to-Many relationships modeling

Are there any drawbacks or better alternatives of this non relational model ? I note that it remains easy to understand but the concern is with the code interacting with. First, as I was introduced ...
1
vote
1answer
3k views

Get the size of list of documents in mongo db

I want to get the size of the list of documents in mongodb. db.getCollection('eventDetails').find({"dateTime" : { $gte : new ISODate("2018-05-01T12:00:00Z") },"dateTime" : { $lte : new ISODate("2018-...
1
vote
2answers
1k views

Copy Specific Columns from DB 1 To DB 2 on MongoDB

I have Two Instance of Node JS server which is handled By NGINX. First server is connect with MongoDB First Server i.e mongoose.connect('mongodb://127.0.0.1/db_primary', { useMongoClient: true }); ...
1
vote
1answer
1k views

duplicate key error index MongoDB

I have rocket.chat server connected to LDAP. When one of users try logging to their account he get logged to someone other account, it's probably because indexes. My logs look like this: [...
0
votes
1answer
449 views

Recover a mongo database deleted by rm

My developer accidentally lost our database by a bash script, which turned out to run rm -rf /* (see this thread). Thanks to extundelete, he just recovered the /data/db/ folder: However, he could not ...
0
votes
0answers
24 views

Is there any way to move expired data from one collection to another periodly?

We have a very big collection, and for getting a better performance, we want to limit the size of "active" collection. That means, we have two collection: "active" and "inactive", we need to keep the ...