Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
47 views

Mongo slow startup after upgrade to 4.2.5

I have upgraded the MongoDB replica set, which consists of 3 members, from 4.0.11 to 4.2.5. After upgrading, startup lasts about 5 minutes. Before upgrading it was instant. It is related to ...
0
votes
0answers
13 views

Would importing MongoDB bson to Atlas halt production database?

Since mongostore does not provide a {background: true} flag, does importing MongoDB bson file halt or interrupt an active Atlas production database? Is there a way to import bson file without ...
0
votes
0answers
8 views

Pymongo: Query data from specific wiredtiger (.wt) files in mongodb

I am new in pymongo. I have some wiredtiger(.wt) available in mongodb as below. I wanted to know what data are being stored in each of the following (.wt) file. All these files are belongs to one ...
0
votes
2answers
27 views

How to find documents that is equal or includes today in its date range?

Given the date, how can I find and return only documents that are in the range or equal to the start or end date in Mongo DB? "startDate" : ISODate("2020-01-01T00:00:00.000+0000"), "endDate" : ...
0
votes
0answers
10 views

Mongodb Automation Agent is not logging in Log file on the server

Our mongodb automation agent is running fine, but it is not logging the logs in the log file on the server. When we check the logs on the ops manager we are able to view it, but on the server its not ...
0
votes
0answers
13 views

Mongodb is taking almost 100% of CPU

Good Morning, I have installed MongoDB on an EC2 machine with 2CPU. At the first time when I SSH Login I See this error message, System information disabled due to load higher than 2.0 However, ...
2
votes
0answers
27 views

Searching across collections based on different column name

I have following collections with fields in my mongodb database: Category cat_id: cat_id_1, cat_name: education cat_id: cat_id_2, cat_name: Sports Keywords key_id: key_id_1, key_name: ...
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 ...
1
vote
1answer
34 views

Mongodb Arbiter Node doesn't start

I have a primary node and second node of mongodb in Production , and a third Node which is the arbiter , after an unplanned shutdown on production last week , the Arbiter node refuse to start mongodb ...
0
votes
0answers
46 views

MongoDB Explain plan - elapsed time breakdown for executionStats

I have run an explain plan for a query, and am a bit confused with the timings of each stage, and how they aggregate to the total elapsed time. Following command was run to generate the statistics, ...
0
votes
0answers
10 views

Separate or Combine 3 entities with same attributes? [duplicate]

What do you do when different database entities have exactly the same attributes? # room name, room type and bed type entities only have name attribute. If I don't combine them, I need to create 3 ...
0
votes
0answers
10 views

How can I merge array of arrays in $project stage?

I merge 2 collections into one mother: { _id: ObjectId(), address: "something" } child: { _id: ObjectId(), name: "something", contacts: [{ "phone": "+144543823..." }, { ... }] } ...
0
votes
0answers
19 views

How can I have multiple group by in MongoDB aggregation?

My sample data is: [{ "company": "apple", "last_view": "2020-01-01" }, { "company": "google", "last_view": "2020-01-01" }, { "company": "google", "last_view": "2020-01-01" }] Now to ...
0
votes
0answers
10 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
0answers
18 views

Mongo compass import csv with accentuation

I'm trying to solve the following problem ... When trying to import data from a csv file into my collection, it happens that in the database some words with accents are left with question marks. ...
0
votes
0answers
15 views

How to create relations to fields with different data types

I need to create an entity, that has a set of fields of different data types, each field has a title and also one of the following: String value Integer value Decimal value Set of options, available ...
0
votes
0answers
34 views

MongoDB select and update with complicated conditions

A server is running multiple processes, process reads task from DB. Tasks contain status and _userid, which is external key for users collection. Look like like: { _userid: ObjectId(), status: '...
0
votes
0answers
19 views

How to speed up a mongodb collection that contains a time-series?

I'm using mongodb to store a time-series (for rendering a plot), with the following format: { _id: // as generated by default time: [array of 32 bit int], // timestamp value: [array of ...
1
vote
1answer
209 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
42 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
27 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: ...
1
vote
0answers
22 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
59 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
1answer
22 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
24 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
96 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
15 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
43 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
1answer
17 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
2answers
195 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
22 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
47 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
29 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 ...
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
0answers
29 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
23 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
41 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
239 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
21 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
49 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
1answer
95 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
1answer
153 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
24 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
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 }, ...
1
vote
1answer
87 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
28 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
46 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

1
2
3 4 5
43