Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mongodb]

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

2
votes
4answers
2k views

MongoDB Export/Import Failed: error counting

I am trying to export data from local database using: mongodump --db ride4you --collection rides But I receive the next error: Failed: error counting ride4you.rides: not authorized on ride4you to ...
3
votes
1answer
82 views

Mongo WriteConflictException in log file

I am experiencing ALOT of this WriteConflictException in my mongo log file, this does not seem to affect the application, because I am not seeing any special errors and everything seems to work fine. ...
0
votes
1answer
750 views

MongoDB unrecoverable replication error

One of member of my MongoDB replica set decided it would not restart, with the following error (reformatted for readability): Starting rollback due to OplogStartMissing: our last op time fetched: (...
0
votes
1answer
19 views

How to get from nested JSON by int rather then by name in MySQL 8?

So I'm currently using MySQL's JSON field to store some data. So the 'reports' table looks like this: id | stock_id | type | doc | 1 | 5 | ...
5
votes
2answers
760 views

Chunk Size is shown as 1 KB in mongo db logs even it is set to 300 MB

I am running a mongo cluster. Chunk size set is 300 MB but for today morning it is showing me in logs that chunk size is 1024 Byte. I checked in current op there also it is showing chunks of 1024 byte....
0
votes
0answers
23 views

Designing a college major model

I'm developing a tool for college students to track their progress toward fulfilling a major and am seeking advice as to how best account for A or B requirements as well course groupings X-Y. For ...
0
votes
1answer
2k views

Is it possible to delete cache in Mongo?

My case is that I run several queries in Mongo and measure the response time. I know that Mongo uses Memory Mapped files and cache some data in RAM. If I create an index and run a query the execution ...
2
votes
2answers
872 views

How to run Mongo database db.currentOp(true) command using API

Using the Mongo Java API I can run the currentOp() command like this: MongoClient mongoClient = null; mongoClient = new MongoClient( "127.0.0.1", 27017); db = mongoClient.getDB("admin"); db.command("...
1
vote
1answer
24 views

How should I build the architecture of my MongoDB database?

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
0answers
16 views

Machine Requirement for Config Server of a MongoDB Sharding Cluster

I need to deploy a Sharded Cluster of MongoDB. I can imagine that my dataset could be no more than 100GB. Now, I need to set the hardware requirements for the server that should hosts the replica of ...
0
votes
1answer
742 views

MongoDB 3.4 Server not starting with bind error following a CentOS 7.4 security update

MongoDB 3.4 server is failing to start following a CentOS security update and reboot. No configuration changes made. The previous update and reboot a couple of days earlier did not cause any ...
0
votes
1answer
18 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 ...
2
votes
2answers
2k views

Getting empty folder when using mongodump to back up my MongoDB

Basically, I have a problem with using mongodump to back up my MongoDB. This is the general syntax I use in SSH: mongodump -d myDatabaseName -o ~/backups/my_backup This is the resulting message: ...
0
votes
1answer
2k views

Can't start mongodb server using 'sudo service mongod start'

I'm trying to set up a dummy mongodb server on my local device so I can play around with it and make mistakes so that I can feel confident editing the actual server. I use the following code to start ...
1
vote
0answers
36 views

How do I add and/or modify $jsonSchema for a MongoDB collection from within the NodeJS driver? [on hold]

I would like to use the MongoDB native schema functionality in a Node application using the MongoDB NodeJS driver. I do not want to use Mongoose for this. Mongoose has it's own implementation of ...
0
votes
1answer
1k views

How to load balance mongodb replica cluster

I have created a mongod replica cluster of 2 nodes , mongo1 and mongo2. to load balance I have added following rule in my haproxy listen mongo_replica_cluster bind *:27017 mode tcp ...
0
votes
2answers
3k views

Mongodb Not Restarting with Collections, WiredTiger.wt may be corrupt

I believe my MongoDB did not have a clean shutdown. I am able to restart it in a new location which doesn't have all of my collections. If I try to repair or start it in the old location, it gives the ...
0
votes
1answer
18 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
1answer
691 views

How to repair mongodb collection when index is corrupt?

Mongo version: 2.6 I think one or more of my MongoDB index is corrupt which is not letting me delete the corrupt collection or make a backup with mongodump Below is the error i get when i try to ...
0
votes
1answer
817 views

How can I perform a mongoimport to a host that requires an SSL Certificate?

I am trying to load some sample JSON data into a MongoDB database (hosted on IBM Bluemix). The connection requires SSL, and a SSL Certificate has been provided, but I keep getting an error when I ...
0
votes
1answer
16 views

How to close mongodb idle connection(active: false)?

I have an application running on node and using the mongodb library to establish connection and closing it. But the problem is, from the mongo serverStatus() command i can see that there is still 2k+ ...
1
vote
1answer
587 views

How indexing on a date field that is constantly updated and or omitted affect performance?

In MongoDB, I have a collection with a date field called last_updated I would like to index. Reason being, I am often querying on a date range of that field in addition to sorting by that field and ...
0
votes
1answer
121 views

Our replica set config is invalid or we are not a member of it - MongoDB

I have started the mongodb server with replica set name 'rs01' enabled on port 27001. Then started another command window to start the mongo db on the same port. The status says the 'rs0' is not a ...
0
votes
2answers
402 views

How can I find out who is trying to connect to my MongoDB?

I have a MongoDB server that I recently configured to allow only SSL connections. Now my mongo.log is filled with this: 2017-05-30T17:39:24.528+0000 I NETWORK [conn7881820] AssertionException ...
0
votes
0answers
18 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 ...
0
votes
2answers
23 views

Mongodb replace default _id with string

I replace MongoDB default _id with type string. And now I want to sort my collections, the result _id after sort is: 1 10 100 101 2 20 200 I want the result like sorting number which is: 1 2 3 4 5 ...
2
votes
1answer
1k views

How to get all documents from a particular chunks in MongoDB?

From mongos log, I got the following message balancer move failed: { chunkTooBig: true, estimatedChunkSize: 408839903, ok: 0.0, errmsg: "chunk too big to move" } from: shard4 to: shard1 I know ...
0
votes
1answer
1k views

How to find sources of connections to Mongodb?

In the Mongodb, I can see there are 54 connections from different applications in my local server. Is there anyway to see which one of my applications are using Mongodb more than the others? Imagine I ...
1
vote
3answers
43 views

Does pure MongoDB use schemas and models like Mongoose?

I'm new on pure MongoDB and I've some questions about pure MongoDB. 1. Does pure MongoDB use schemas and models like Mongoose ODM? If you have used Mongoose ODM, you know that Mongoose ODM uses ...
0
votes
1answer
448 views

Adding secondary via rs.add on MongoDB

I have a master and slave on Linux (centOS 7). The rs.initiate(cfg) was done, but its shows the below output when trying to add secondary via rs.add: genienational:PRIMARY> rs.add("localhost....
0
votes
1answer
1k views

Binding specific ips with Mongodb

I am using Mongodb 3.6.3 on Centos 7. I am running the below command: sudo mongod --storageEngine wiredTiger --dbpath /data --bind_ip_all --logpath /var/log/mongodb/mongod.log --fork and ...
0
votes
1answer
41 views

Integrating MongoDB metrices with Cloud watch

We are hosting mongodb in AWS environment and planning to create incident in Servicenow using AWS Cloud watch alarm facility Has anyone integrated MongoDB Monitoring metrices with Cloud watch to ...
2
votes
1answer
381 views

Progress of mongodump operation jams at a random point

We are executing remote mongodumps to backup collections. For some time now sporadically one of these dumps stops to progress any further and remains to log out the same amount of documents processed ...
1
vote
1answer
110 views

Service Discovery for MongoDB

What is the best way of implement a Service Discovery like ETCD for use in a mongodb cluster? I wish have, 1 master for HA and two nodes, in my master i have a static ip, but nodes maybe can changes ...
2
votes
1answer
967 views

How to add `--sslAllowInvalidCertificates` on mongodb uri?

I have a mongodb server requires x.509 certificate. So I have to use --sslPEMKeyFile and --sslCAFile on mongo shell command to connect to that server. It works fine. In my dev environment, I am using -...
0
votes
2answers
1k views

Cannot connect to mongos

Following the MongoDB Sharding Documentation, I start a mongos using a configuration file with the specifics of my config server. It seems rather straightforward, yet I am running into an issue. I ...
0
votes
1answer
26 views

Configure mongo for one shot full db read

I have a kubernetes cluster on bare metal with 3 machines having 8Gb of ram each. All my apps and a mongodb 4.0.9 replicaset runs on it. There is an import program that: Download a 8Gb mongo dump ...
0
votes
1answer
645 views

Indexes are not visible in a MongoDB replica set

On a local MongoDB instance i can connect using the mongo client, define an index using this command db.collection.createIndex( { score: 1 } ) and then view that index and the default _id index ...
1
vote
1answer
1k views

MongoDB: movechunk failed after adding a new share to cluster

I have a MongoDB cluster version 2.6.8, which already has two shares: share1 and share2. When I add a new share3 to the cluster, data chunk can't migrate to share3. This is from the mongos log: ...
0
votes
2answers
18 views

Periodic aggregations on MongoDB Atlas

I have been developing a solution that uses MongoDB Atlas (currently M0) for storage. As I would need to provide some statistics throughout different time periods, I need to run periodic aggregations ...
0
votes
1answer
36 views

what is most efficient way to retrieve next and previous items based on ordering and current item only

So I have this problem in many of my apps and I don't even know how to describe it correctly. I'm using MongoDB (3.6) so my IDs are hashes. I have a table/grid view, which displays items mapped to ...
1
vote
4answers
2k views

MongoDB: Server sockets closed after a few minutes

I am working with multiple AWS intances connected to the same MongoDB database (inside Compose.io Elastic deployment). But i am getting the error server <url>:<port> sockets closed after a ...
0
votes
2answers
35 views

CSV file restore in mongodb

Export MySql data in following command. SELECT id,documentfile FROM documentuploads INTO OUTFILE '/home/home2/agri_doc.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'; CSV ...
0
votes
1answer
318 views

Error while doing in replicaset in windows (MongoDB)

I tried doing the replicatset in windows, but im getting the below error. I checked the mongo process and killed the existing process. Even though the error exists. help me on this pls Thx ...
1
vote
1answer
39 views

MongoDB replica set outage “due to bad connection status”

I have a production replica set that went down for 3-4 minutes, apparently because the Primary could not connect to the Secondaries. I'm having a hard time understanding why a Secondary didn't take ...
1
vote
2answers
75 views

How to influence files (pre)allocation steps (max growing value) in MongoDB 3.4 with WiredTiger

We have in environment deployed some really small DBs (5GB) as directory per DB.Under dirs is LVM with XFS, where we have implemented logic for "brake" when DB space should be full-filled (all is due ...
0
votes
2answers
26 views

Mongodb users in replica

1) I have mongo instances A, B and C, each having a different set of users with different roles. I have used mongo shell to connect with A through an Admin user. Now, to create a replica and add B and ...
0
votes
1answer
418 views

mongo cluster collection count showing different every time

I had a replica set earlier which I have converted to cluster. Current configuration is: 3 shard 4 router 4 config server When I am trying to get count of one of collection sometime it is showing ...
0
votes
1answer
86 views

In MongoDB serverStatus(), what is the meaning of “connection data handles currently active”?

When running db.serverStatus() in the MongoDB shell (3.4, WiredTiger), the results contain the following data: { "connection data handles currently active" : 94862, "connection sweep ...
3
votes
1answer
958 views

MongoDB can't add new replica set member [rsSync] SEVERE: Got signal: 6

I have a replica set and I added a new member to the set. The initialSync begins for the new member and rs.status (on primary) shows STARTUP2 as status. However, after a long enough time, there's a ...