Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
15 views

mongodump command with timestamp query

When I execute the below query in mongodb shell, it gives me the number of records updated after the mentioned timestamp. db.getCollection('oplog.rs').find({"ts":{"$gt":Timestamp(1582823397,2)}}) I ...
0
votes
0answers
15 views

How to reclaim disk space on a MongoDB Atlas replica set?

I migrated a replica set from mLab to MongoDB Atlas. mLab offered an automated process to reclaim disk space after dropping large amounts of documents from a collection. Compacting (or resyncing) ...
0
votes
0answers
19 views

Fastest way to make full text searches through 2 columns?

I actually have 200 GB of data indexed on MongoDB, spread over 2 columns, each containing one string. The user search for 'cowboy', if this string is found anywhere, it returns the content. i.e: ...
-3
votes
1answer
26 views

What is a connection pool?

Please explain me what is connection pool in Postgres and MongoDB database.
1
vote
0answers
9 views

Mongo connection problem in Kubernetes with Rails

I am deploying mongodb to Kubernetes with following values: mongodb: persistence: enabled: true existingClaim: mongodb-pvc volumePermissions: enabled: true mongodbRootPassword: ...
0
votes
0answers
15 views

How can I clone a MongoDB database in a script?

I'm a newbie to mongo, and I've written the following script to clone a database in Mongo: echo 'Enter db to clone: ' read dbToCopy echo 'Enter name for cloned db' read newDbName dumpUri="mongodb://$...
0
votes
0answers
7 views

Do we need to shutdown DB/Stop DB service before Windows server patching

Before patching Windows server, do we need to shut down any DB or stop DB service. If we need to shutdown a MongoDB on a node(Windows server) which is part of a replica set, what we need to before ...
0
votes
1answer
19 views

Run Mongodb Server as Service and mongod instance

I am using ubuntu and can run mongodb server by the following command systemctl start mongodb But, if i want to run Mongodb by mongod mongod --dbpath /var/lib/mongodb it gives me Permission ...
0
votes
0answers
22 views

AWS DocumentDB vs MongoDB performance issue

I am helping to support a Node.js application which uses MongoDB on an EC2 instance as the back end. The database is about 14 GB and the largest table has a little over 15 million documents. To test, ...
0
votes
0answers
20 views

mongodb using 700% cpu usage [closed]

Trying to figure out what I'm doing wrong here. I have read multiple posts so far for high CPU usage and trying their fixes. Such as taking off logging connections. Quiet mode. None seem to work sadly....
0
votes
0answers
23 views

Which DB for dozens of billions of rows, 2 columns, to search with the fastest way any “pattern” ? MySQL / MongoDB / HBase / Elastic Search? [closed]

The user search for 'cowboy', if this string is found anywhere, it returns the content. i.e: Description / Name 'super cowboyis me' / 'foo' 'lorem lipsum...' / 'bar' -> FOUND: 'super cowboyis ...
0
votes
0answers
8 views

Separate MongoDB Table Server got down

This issue is very new for me. This scenario is about Production as per I have kept some large tables on other server. for a month The Server was going smooth but after one month it got down ...
0
votes
2answers
37 views

Referencing two documents to each other

Is it good practice and or recommended to reference 2 documents to each other using ref? Like this: const FirstDocumentId = mongoose.model( 'FirstDocumentId', new mongoose.Schema({ ...
0
votes
0answers
10 views

How to reject unvalidated SSL client connections from the MongoDB server?

I have setup a MongoDB server with a self-signed server certificate, and when I use the server validation method in Compass along with the CA certificate, it works well. However, I am still able to ...
0
votes
1answer
24 views

clone collection in mongoDB in the same db

I want ti copy my collection including is indexes without the data. how can I do it in the most efficient way? I am using a replica set version 4.0.3
0
votes
0answers
20 views

How is MongoDB cursor implemented?

What's happening in Mongo when you are calling find and iterating over cursor? I mean, how is cursor actually implemented? I understand that when you call find, you'll get reference to cursor (or ...
0
votes
1answer
17 views

MongoDB Replication initial sync fails with OplogStartMissing

I'm currently testing replication in our development environment. Our current (primary) mongo instance has around 70-80 GB of data. I created a new instance and added it to the replica set. It takes ...
0
votes
0answers
24 views

Distribute data between MongoDb Shards

I have a development environment with two shards, one configuration server and one router as illustrated below. I have a sharded database "mydb2" and a sharded colleciton "mycollection2". When I ...
-7
votes
1answer
51 views

Why did/does PostgreSQL, MongoDB and probably other database softwares allow such dangerous configurations? [closed]

A number of years ago now, still well into the 2000s, I was very naive. Especially in terms of computer security. To make a long, painful story which I don't even remember myself all too well, the ...
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
0answers
13 views

MongoDB cluster use x509 for internal authentication only

I'm setting up a sharded cluster. I've enabled TLS and added certificates to each server in my shards/config replica sets and also my mongos instance. But is it still possible to connect to the mongos ...
0
votes
0answers
15 views

How to enable access control on mongos

I've tried to start my mongos instance with access control using the --auth option but I get Error parsing command line: unrecognised option '--auth'. How do I require authentication to connect to the ...
0
votes
0answers
16 views

robo3t - mongodb client connection error

I have a mongodb 4.2 replica set running on 3 different VMs. Here are some parts of the server config: net: port: 27017 bindIp: 127.0.0.1,::1,other_not_telling.com tls: mode: requireTLS ...
0
votes
1answer
32 views

How to remove XFS filesystem warning in mongodb shell?

Every time I start a mongodb shell, I get this annoying warning: Server has startup warnings: 2020-02-01T08:54:27.220+0100 I STORAGE [initandlisten] 2020-02-01T08:54:27.220+0100 I STORAGE [...
0
votes
1answer
18 views

MongoDB Shard Zone Range Overlapping

I am configuring a test mongo setup with 2 shards, and I'm trying to add zone ranges to each shard: sh.updateZoneKeyRange('mydb.test', {id:MinKey,ts:MinKey}, {id:MaxKey,ts:1548787704000}, 'cold') sh....
3
votes
1answer
37 views

adding and removing a node from a mongo replica set

I have a new backup server I want to add to our mongo replica sets. As far as I can tell its as easy as logging on to the replica sets primary and adding the following command: rs.add( { host: "...
0
votes
1answer
16 views

Creating a relationship between a document and a collection in MongoDB

I have no idea if this is even possible but I'd like to find out if there's some way to create a relationship between a document and a whole collection. I have a user schema that looks something like ...
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 ...
0
votes
0answers
43 views

Mongo E11000 duplicate key error collection after mongo 3.4 to 3.6 upgrade

I have a Mongo replica set on Ubuntu with three members configured for my information system and am having issues when I try to upgrade MongoDB from version 3.4 to 3.6 After setting the "...
0
votes
1answer
19 views

Why do databases in mongodb have roles?

I have read about mongodb role based access control and I have understood it to a large extent. I was going through this tutorial and when you run show roles on the mongo shell it returns a different ...
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 }, ...
1
vote
1answer
27 views

Is it possible to backup users from MongoDB admin database?

The title sums it up nicely. Essentially what I am asking is, if its possible to backup (use mongodump perhaps?) only users (accounts created for human users)?
0
votes
2answers
26 views

MongoDB new secondary replica set node has much smaller data folder (dbPath)

I have a 3 node replica set that's been online since mid december. Last Friday (Jan 24), we added a 4th node in our disaster recovery data center. We used the automatic initial sync procedure as our ...
0
votes
0answers
34 views

Encryption in transit not working in MongoDB

I am using MongoDB 4.0.6 with 3 node replica set. I am upgrading my cluster to use SSL, below are steps which i am following : 1) generated CA.pem, server.pem and client.pem file and updated in my ...
0
votes
1answer
8 views

There is any way to log all mongodb query into file in nodejs? [closed]

There is any way to log all MongoDB query into a file
0
votes
0answers
24 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 ...
1
vote
1answer
37 views

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

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
26 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 ...
0
votes
0answers
21 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 ...
0
votes
2answers
74 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
18 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/...
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
24 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":"...
0
votes
1answer
14 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
26 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 ...
1
vote
1answer
34 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. ...
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
0answers
22 views

Aggregation in mongodb and group by 15 min

I have a Schema in mongodb like: INPUT { _id: ObjectId("5e05c1089b3e4e333cee8c39"), name:"Alex", activity:[ { _id: ObjectId("5e05c1089b3e4e333cee8c39"), type: '...
0
votes
1answer
37 views

Mixing sharding and Replica in MongoDB cluster

We know there are two ways to create a mongoDB cluster :- 1.) Sharding 2.) Replication My question is can we combine both sharding & replication like we have in elastic cluster?
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 ...

1 2 3 4 5 42