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
19 views

Spliting changes in separate collection/table or not?

I am using MongoDB to store products, user accounts and stuff on my server and so far it's going nice. But now I'm stuck deciding how do I "split" things apart, like: I have a database where ...
1
vote
0answers
39 views

Lots of CLOSE_WAIT and SYN_RECV Captured From ARBITERS With 'netstat'

I have a cluster with 7 nodes: 1 primary, 3 secondary and 3 arbiters. I also have several more app servers which communicate with the cluster. Recently, we've received lots of errors in the mongodb ...
0
votes
1answer
388 views

Can't solve MongoParseError: Invalid connection string

I'm not able to solve MongoParseError. First my I tried this mongoose.connect(`mongodb://${process.env.DB_USER}:${process.env.DB_PASSWORD}@db:27017/${process.env.DB_NAME}`, {useNewUrlParser: true}); ...
-2
votes
1answer
16 views

Please guide me to change 1 node standlone to 2 node 1 arbiter Replicate Set [closed]

Please guide me to change 1 node standlone (have data) to 2 node 1 arbiter Replicate Set
1
vote
1answer
50 views

Is MongoDB secondary index size affected by primary key size?

If I understand correctly, secondary index leaf nodes in MySQL InnoDB engine hold the table primary key value (at least for a unique index). Thus, looking up a value in the secondary index results ...
1
vote
0answers
47 views

MongoDB Fails due to permission error even though its setup

Attempting to start my MongoDB server using service mongod start fails for the reason: exception in initAndListen: IllegalOperation: Attempted to create a lock file on a read-only directory: /var/lib/...
0
votes
0answers
22 views

compund MongoDB index with _id

I have database with few fields: _id, field0, field1, field2, field3, field4, field5.. I created index on as follows: db.usertable.createIndex( { _id: 1, field1:1} ) The expected that a query ...
0
votes
0answers
19 views

Is it recommended to monthly planned restart MongoDB production server to clean non-mapped virtual memory?

We have a replica set of production mongoDB 3.6.10 , large volume of 5.5 TB , over 10,000 connections anytime , applications read both from primary and secondary servers , we see almost every month a ...
1
vote
1answer
43 views

Is it possible to move mongodb indexes to another file system?

Is it possible to separate MongoDB files location so the indexes are on another file system? In the example below, I have database with 1.5TB of data + indexes of 330GB. I have a very fast storage ...
0
votes
1answer
63 views

distinct values from multiple fields in array

I have a similar mongodb collection: [{ "country": "France", "exchange": { export: [{ resource: 'MILK', origin: ['Toulouse', 'Bordeaux'] }] ...
0
votes
1answer
29 views

Is mongodb upsert the right option for write intensive use case?

I'm designing a data model for a transactional use case which is write intensive. The write load would be 900 - 1,600 Transactions Per Second (TPS) which would account for 30 million Inserts/Updates ...
0
votes
2answers
24 views

mongodb schema design advice

I have a users index which has fields like id, email, password, etc. A user can see all other users except the ones who had blocked him. I want to design a database schema for this problem. So I'm ...
0
votes
0answers
35 views

Mongodb Replica Set Collection Has Different Document Count

I've created a new 3 node replica set and rsync'ed data from an existing mongo database for initial population. The secondary nodes went into STARTUP2 mode and seemed to successfully sync from the ...
0
votes
0answers
36 views

is it possible to make multiple mongo routers connected to just one shard on a mongoDB shard cluster?

I'd like to make a mongo cluster with multiple mongo routers(mongos) with just one shard(mongod) like thses figures. So I made two mongo routers named 'mongorouter-1', 'mongorouter-2', and also ...
1
vote
1answer
37 views

MongoDB query choosing the wrong index in winning plan, Though in executionTimeMillisEstimate as lower for the other index?

MongoDB Query chooses the wrong index in the winning plan. I have two indexes for the same field, one is a single field index and a Compound index with another field. Eg. Field name: Field1, ...
0
votes
1answer
328 views

can't update user password on Mongodb 4.0.5 (Use of SCRAM-SHA-256 requires undigested passwords)

I'm trying to update a password from a user, using changeUserPassword(), and I just receive the following message: Error: Updating user failed: Use of SCRAM-SHA-256 requires undigested passwords &...
1
vote
0answers
27 views

Mongodb throwing an error when I run the query to record last position from oplog

I am getting an error when I run the query in the secondary member to record the last position from the oplog. below is the query. db.oplog.rs.find().sort({$natural:-1}).limit(1).next().ts and the ...
0
votes
1answer
30 views

Why a query is not covered when using a range operator on documents?

I have created the following 1000 documents: for(i=0;i<1000;i++){db.doc.insert({"doc":{"k1":"v_"+i,"k2":i},"scal":i})} So a document looks like this: var d1 = db.doc.findOne() { "_id" : ...
0
votes
0answers
121 views

Mongodb return Error : $cursor stage :: caused by :: operation was interrupted

In recently, i meet a problem with mongodb. After i surveyed on google, there is no good result unfortunately. So i really wish anyone could answer it. As title, there is a kind of error message in ...
1
vote
0answers
22 views

Mongodb - Security weakness while using --authenticationDatabase admin? [duplicate]

I was trying to create a new Mongodb instance based on my old Mongo Database. In my current DB I have an user and password configured. So, I can access my database using: $ mongo --host $MONGO_HOST -...
1
vote
0answers
24 views

MongoDB / PHP - How to change data type for every occurrence of field in a document

I'm trying to learn how to use MongoDB with PHP. I Have built a web application that loads data from database etc. The issue I am having is that when I import my data from a .CSV using MongoDB Compass,...
0
votes
0answers
14 views

MongoDB user password changed for already open connection

We're introducing this new password management infrastructure that changes passwords every X days, but there're these existing implementations in place that use singleton repositories, so once a ...
0
votes
0answers
20 views

mongodb after restoring replica-set from backup the primary is not master

after recovering replica-set from a snapshot (for testing) when I run commands on the primary I got error not master and slaveOk=false does primary not equal to master? I got this output for the ...
0
votes
1answer
50 views

Exception during recovery in mongo

I tried to recover from a sudden shutdown of mongo, but I am experiencing some problems. Here is the log file ***** SERVER RESTARTED ***** Thu Apr 25 01:09:17 [initandlisten] MongoDB starting : pid=...
0
votes
1answer
17 views

mongoDB: Limit user to find documents only by ObjectId

I'm using mongoDB version 4.0.9 for various things. One of them is storing and retrieving files in mongoDB via GridFS. For that purpose, I have created a role/user in mongo with the privileges "...
1
vote
0answers
10 views

Mongo DB sharding concept of read/write [closed]

I am trying to set up mongodb sharding and almost done. 1. completed 1 config replicaSet 2. completed 1 shardsvr replicaSet 3. multiple mongos routers connected to config and shardsvr also done I ...
-1
votes
1answer
54 views

What are the pros and cons of having more data-bearing members in a MongoDB replica set? [closed]

A 3 member replica set has the same fault tolerance if all 3 members contain a copy of the data or if one is an arbiter so why would I ever want all 3 members to have a copy of the data? What is a ...
1
vote
1answer
22 views

Mongo DB multiple replicaset

I am trying to create multiple mongod instances on windows . I run on 2 ports [27017,27020] with replSet ["ReplSet1","ReplSet2"]. first instance 27017#ReplSet1 is OK. But the second instance 27020 ...
0
votes
1answer
21 views

Is it possible to retrieve a history of the remote connections to the MongoDB including the IP addresses and the executed commands?

For some reasons I disabled the user access control and somehow all collections have been wiped out. So I want an activity log to find out how this happened I need a list like this: | Date/Time ...
0
votes
1answer
27 views

Why does a query on a sparse index perform much faster than a query on a partial index in MongoDB?

I created a sparse index in my MongoDB Atlas like so: db.detection_events.createIndex({"emp_id": 1}, {sparse: true}) When I performed this operation: db.detection_events.count({"emp_id": {$exists: ...
1
vote
1answer
42 views

Writing MongoDB logs to a remote logging server

I am trying to forward MongoDB logs from several remote servers to a central logging server. To do this, I changed my mongod.conf files to use syslog like so: systemLog: destination: syslog ...
0
votes
0answers
17 views

mongodb auto index future collections, big json size, correct structure?

We are going to index some data in mongodb (probbably), from some api calls sending json data ~10MB size, splited data in dates. Since the data is large, I think it's better to split the result in ...
1
vote
1answer
36 views

My MongoDB Atlas Operations graph has doubled in the last few hours. How do I go about debugging this?

I noticed this graph in my MongoDB Atlas dashboard: I'm not sure what is causing the increased Disk IOPS and Operations counts... Can I use the oplog to figure out what is causing this massive ...
0
votes
1answer
42 views

optimized query mongo find

I want to fetch all data from a collection. Since running just find({}) crashes the mongo container (the liveness probe seams to fail because k8s reboot the container), I ask myself if using skip/...
1
vote
0answers
51 views

How to choose database for scalable chat systems? [closed]

I have made a chat application where for now I am storing complete history of chat of all the users. I am using django as backend and postgres as the database. I am nearing 100k daily active users ...
0
votes
1answer
37 views

MongoDB - Does WiredTiger benefit from virtual cpus cores the same way it does with physical cores?

According to https://docs.mongodb.com/manual/administration/production-notes/#id5 The WiredTiger storage engine is multithreaded and can take advantage of additional CPU cores. We will be running ...
1
vote
1answer
48 views

Why $group is very slow in aggregation and how can faster it in MongoDB [closed]

My query is taking ~3 seconds to execute with the $group stage, How can I faster this? My query is: db.getCollection('employee_data').aggregate([ { $match: //Filter }, { $group: { ...
0
votes
0answers
50 views

Converting MySql Schema to MongoDB (Mongoose)

I am trying to convert MySql schema to MongoDB. I do understand how to make a reference to Users Table - UserId. My question is how to make a reference to Symbols Table - Symbol ? Here you will find ...
1
vote
2answers
51 views

Can sharding help in this scenario? [closed]

I will have around 600 GB of data in single table with multiple columns in MySQL. Basically this table will store user events from application. Indexes are there on required columns. Question: If I ...
0
votes
0answers
35 views

Error: No primary detected for replcaset

We have a Mongo cluster with 4 shards. Each shard with 3 nodes (Primary, Secondary, Arbiter). (rs1,rs2,rs3,rs4) - config server rs1 shard completely down, so we rebuilt the rs1 with backup we have ...
0
votes
1answer
37 views

mongodb read write locks

I'm currently investigating the possibility of using mongodb. This would contain the a collection of 100million+ documents. I need a process that will be constantly running deleting documents older ...
-2
votes
1answer
45 views

Is MongoDB an appropriate choice for storing large files as compared to MySQL? [closed]

I'm working on a project to store large JSON files (~1 MB each) in a database, with 10 of these files linked to one user profile. Normally I would use MySQL, and have two tables, one with the meta ...
1
vote
1answer
64 views

Impact of RAM size on mongodb performance

I'm trying to test the impact of the size of RAM on the performance of mongodb. So far I can't find such impact and trying to figure out if the methodology I use is correct and if not, what to change. ...
1
vote
0answers
136 views

MongoDB ReplicaSet instance re-join after Kubernetes POD restart

I have simple MongoDB deployment in Kubernetes with PersistentVolumeClaims. Roughly like this: apiVersion: v1 kind: Service metadata: annotations: service.alpha.kubernetes.io/tolerate-unready-...
0
votes
0answers
38 views

Mongo - Find is returning differents results with each request

Currently in my collection has the following spec: Version: MongoDb - 4.0.6 Sharding: 3 shards Shard key: Publication identifier The shards are consistent The problem is due using the same operation ...
0
votes
1answer
121 views

Installation problems

After a fresh install of mongodb following the instruction here https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/index.html I seem to have a problem: ludo@aegir:~$ sudo service ...
1
vote
1answer
32 views

How should I build the architecture of my MongoDB database? [closed]

I have a project about e-Sports. In this project, I have VDS Game Servers for players. With this game servers, our players will play Ranked Games and players will earn Matchmaking Rank Points for ...
0
votes
1answer
21 views

What are each of the separate mongodb-org packages for ubuntu?

I am installing mongodb on a local ubuntu vm and I'm using the official Mongo supported packages per the official instructions. However, I don't know what each of these packages contain. I know this ...
0
votes
1answer
54 views

MongoDB failed to start after adding keyFile config

I have issue with mongod service after adding keyFile in config. I follow instruction from here : https://docs.mongodb.com/manual/tutorial/deploy-replica-set-with-keyfile-access-control/ after adding ...
0
votes
0answers
26 views

Mongo zoned sharding with a single value

We have a database with around 50 collections, and 70 million records. All records belong to specific customers and have a customerId property. Currently all clients are in the USA. However, we're in ...