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
5 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
0answers
6 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
12 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
18 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
15 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
8 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
16 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
0answers
19 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
22 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
7 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
-2
votes
0answers
49 views

How can retrieve deleted mongodb database in ubuntu server? [closed]

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
0answers
12 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
0answers
23 views

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

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
31 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
19 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
14 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
48 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 ...
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
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/...
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
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":"...
0
votes
1answer
12 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
25 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
31 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
12 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
20 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: '...
-1
votes
0answers
16 views

Looping Over a Java Object and Passing One Field to a Mongo Query Similar to SQL WHERE…IN Clause [migrated]

I am trying to construct a MongoDB equivalent of an SQL WHERE IN clause by iterating over a Java Object List and using one field in that list to fill in the IN data. Using generic example, I would ...
0
votes
1answer
33 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
48 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
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 ...
0
votes
0answers
11 views

Force timeout on MongoTemplate aggregate API

Is there any way to add time out parameter maxTimeMs in the below query? I want the aggregation to time out after 1 minutes List<AggregationOperation> aggregationOperations = ...
0
votes
0answers
12 views

Can't do sum aggregate on Tweet Api

I'm new using mongodb and using the function .find() to search documents. Recently I've been working with the tweeter API and I have to do some "queries" regarding the results of my requests. This ...
2
votes
0answers
24 views

Sharding state recovery process found document - contains wrong list of config servers

I've been stuck on this issue for the most part of the day, feel like I am hitting a wall. I hope someone more knowledgeable can help me. Historical Setup Mongo Shard (4x replica sets) Config ...
0
votes
2answers
19 views

Return all except some fields using findOne() in mongodb for node.js

I am trying to use the following script to query for a document but the returned document still contains the field (password) that I don't want. const client = await MongoClient.connect( ...
1
vote
0answers
31 views

Update is not taking index for query

In the logs I found slow queries, but when running them manually it is fast or at least taking indexes into account. The logs tell me the query part is not using an index, which is available. Running ...
1
vote
1answer
28 views

Mongo Cluster sharded replica cluster design question

I have 5 old servers, each with single socket CPU, 4 physical cores(8 logical) and 128GB of RAM. I am getting started with mongoDB and plan to deploy MongoDB 4.2.2 on my 5 servers for a lab ...
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:...
0
votes
1answer
13 views

MongoDB deleted logs

So I recently realized my /var directory was growing but couldn't find anything using du, then find out about lsof and found the following: lsof -nP | grep '(deleted)' mongod 23184 23205 ...
0
votes
1answer
20 views

mongodb 2.4.1 instance shutdown without log

I am running mongodb in a replica set of 3 nodes (no sharding). But since 5 days the secondary instance shuts down intermittently, once in 2 days. Log does not indicate any event related to shutdown, ...
0
votes
1answer
32 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
61 views

Mongo: group query runs for hours then errors

I have a Mongo database with a collection with 1 billion rows. Each document has three fields, _id, Input and Hash. There are indexes on each of these fields. I'm attempting to run the following ...
0
votes
1answer
19 views

MongoDB | Problem inserting embedded documents into document

I am trying to insert data in a nested format. A snippet of my models (there are many, many more): class LifetimeMode(db.EmbeddedDocument): meta = {'collection': 'lifetime_mode'} career = ...
1
vote
1answer
62 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 ...
0
votes
2answers
96 views

Mongodb Sort Array Objects within Array using expression

Please help to make query in mongodb. I want mongo query in which sort array objects using some expression. Example. I have documents like { "_id:"...
2
votes
1answer
33 views

Is it possible to migrate data from a shard MongoDB to a non-shard MongoDB with dump

Question: I have a shard mongo cluster and I want to migrate data from this cluster to a one node mongo instance. So I want to know is it possible to use dump/restore? I use pymongo and Django ...
0
votes
0answers
22 views

How to structure cancelled orders?

I'm working with NoSQL Database "Firebase", and I have a node that contains 6 categories "services" in everyone I put an array of orders well? now when the user logged I get/fetch all orders bassed ...
1
vote
0answers
46 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
1answer
28 views

Transfer image files from MongoDB to S3

I have a NodeJS app that stores all of its data, even images, to MongoDB. Now I want to use an S3 (DigitalOcean Space) to store my app's files (images, 43gb) and so, I need to transfer there all files ...
0
votes
1answer
95 views

MongoDB Atlas M0 (Free Tier) BI capabilities

I'm using MongoDB in my server and developed BI tool using cube-js & mongosqld, which worked when mongo was running locally, however after I moved to Atlas using M0 tier I could not connect to it ...
0
votes
0answers
11 views

When changing the Mongodb Ops Mgr to FQDN, All Agents on all servers in the deployments goes down

Our Mongodb Ops Manager servers had to changed from short hostname to FQDN due to SSL certificate updates. When we updated the SSL certificates on one of the Ops Manager servers, all the agents(...