Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
-1
votes
0answers
32 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
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
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 ...
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 ...
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 ...
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
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 ...
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. ...
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
47 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
23 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
19 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
18 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
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 ...
0
votes
2answers
90 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
88 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(...
1
vote
1answer
38 views

how to retrieve mongodb admin password installed on AWS EC2

3rd party developers have installed MongoDB on AWS EC2 instance and later handed over code to me. Now I don't know what's the password for admin user of MongoDB but I do have ssh keys to connect to ...
1
vote
1answer
43 views

Does local.oplog.rs hold all data in mongodb replication?

I'm trying to do backup full and incremental backup, I wonder does local.oplog.rs collecitons contain all info that I need to do backup and incremental backup?
0
votes
1answer
24 views

How to use variables in a mongodump query

I want to backup data of last day (Current Day-1) every day using cron tasks. In the mongo shell, I can query the data using variables as below: var start = new Date(); start.setHours(0,0,0,0); ...
1
vote
1answer
41 views

permission denied on mongod.lock, despite it being owned by mongodb

this is my mongod.lock: -rw-r--r-- 1 mongodb mongodb 0 Dec 3 17:09 mongod.lock hence this solution doesn't apply: https://dba.stackexchange.com/a/183018 this is how I start mongodb: sudo ...
-3
votes
1answer
52 views

From a backup strategy perspective, would it be efficient to use a relational DB (as MySql) and a document oriented DB (as MongoDB) in the same app?

I am developing an app where I need to store an undetermined number of properties for any given entity, for example: Entity || # of properties** Apples || 14 Oranges || 4 Pears |...
0
votes
1answer
24 views

Inserting records into Mongodb using Pymongo is using up my RAM incrementally and is eventually exhausting all memory

I am writing Python code that parses through a huge XML document of size 17GB(Wikipedia collection) and inserts each page title along with the links in that page (storing as a list) present on the ...
0
votes
0answers
37 views

Can I recover data from a WiredTiger .wt file?

I'm trying to recover data from a collection in MongoDB 4 using WiredTiger. I managed to recover the deleted .wt files from the disk, and by opening the files on a text editor I can see some of the ...
0
votes
1answer
32 views

Filter based on values after join operation - MongoDB

I have two collections in the following format - collection1: { "_id": "col1id1", "name": "col1doc1", "properties": [ "<_id1>", "<_id2>", "<_id3>"] } collection2: { ...
0
votes
1answer
33 views

Can I set different database directories in MongoDB?

In db2 we can create databases on different directories through db2 list db directory. Can we also do that on MongoDB? I am aware of the dbPath in the config file. But do all databases created have ...
0
votes
0answers
24 views

Hyper-V Live-Migrating MongoDB Server

Does anyone know if DBs in general or in this case a Centos 7.x box running mongoDB would have corruption or any issues for that matter, if Live migrated from one host to another ? These are hosted ...