Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
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
139 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 ...
1
vote
0answers
127 views

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

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
49 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 ...
0
votes
1answer
475 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+ ...
2
votes
3answers
275 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
29 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
2answers
87 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
44 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
1answer
370 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 ...
0
votes
2answers
112 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
2answers
35 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 ...
1
vote
2answers
95 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 ...
2
votes
1answer
437 views

how to generate the root CA.pem in mongodb for configuring the ssl certificates?

I am trying to configure the SSL certificates in the MongoDB community edition. The configuration of my mongod.conf net: port: 27017 bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and ...
0
votes
2answers
55 views

arbiter bring down the three node mongodb replica set [duplicate]

I have a typical 3 node mongodb replica set. One primary, one secondary and one arbiter. I thought the replica set would survive one node offline but it didn't. Please help me understand what went ...
1
vote
1answer
337 views

connecting to mongodb on ec2 instance using the private IP address

Im trying to connect to my MongoDB that is on my EC2 instance. I am able to connect to using the public dns with this statement: mongoClient = new MongoClient("ec2-3-92-197-163.compute-1....
0
votes
2answers
335 views

Mongo count query taking long time though index is being used

The following count query is taking lot more time than expected though index is being used and keysExamined , docsExamined are also less query = {'indxed_field': 'x', 'a': 'test', 'b': {'$ne': True}...
1
vote
1answer
185 views

First query is really slow with WiredTiger, not with mmapv1

We recently upgraded to MongoDB 4.0. Loving the performance improvements with WiredTiger, but all of a sudden our test suite is timing out on certain machines. Before running our tests, we run the ...
1
vote
0answers
90 views

MongoDB SECONDARY replica keeps failing on STARTUP2

I'm converting standalone existing MongoDB instance to a replica set for backing up without affecting primary instance. To test minimal replica deployment I've set up two MongoDB instances on the same ...
1
vote
0answers
22 views

How to store metadata derived from Named Entity Recognition (NER) in MongoDB documents? [closed]

I have collection of news articles in this format: { "_id" : ObjectId "author" : "title" : "description" : "url" : "urlToImage" : "publishedAt" : "content" : ...
0
votes
1answer
681 views

How to update a field in a nested JSON document in Mongo?

How to update a field in a nested JSON document in Mongo? { _id : '123' friends: [ {name: 'allen', emails: [ { video: { name:'abc', subType:'video', ...
1
vote
1answer
44 views

Import indexes from MongoDB v2.4 to MonDB v3.6.4

I have migrated the collection.bson file from MongoDB 2.4 to MongoDB 3.6.4 as collection.json. But their is 1 more file collection.metadata.json in MongoDB 2.4. How can I import this to MongoDB 3....
0
votes
0answers
35 views

trying to merge chunks to trigger better balancing after 50% of the data was deleted by the developers

Trying to merge chunks using the following command: db.adminCommand ( { mergeChunks: "HTMLDumps.HTMLRepository", bounds: [ { "ShardMapId" : 2, "DomainId" : ...
1
vote
1answer
138 views

Set mongodb's `maxIndexBuildMemoryUsageMegabytes` setting in conf file

In the mongodb documentation for the configuration options it says that I can specify how much RAM index building will consume: maxIndexBuildMemoryUsageMegabytes: Limits the amount of memory ...
0
votes
1answer
39 views

Help understanding mongodb explain results

I have an index on field f1. {f1:1} Running an explain on the following query db.coll.find() says that the winning plan is a CollScan (expected) However, for db.coll.find().sort({f1:1}) the ...
1
vote
1answer
105 views

Connect mongodb 4.0 with robomongo

I am facing an issue with the mongodb 4.0. I have setup mongodb on remote server and want to connect it with robo3t. But getting the below error. And here is my mongodb.conf file # mongod.conf # ...
0
votes
1answer
91 views

Is MongoDB index creation single threaded?

I have rather big dataset - 2TB of text data, 18.000 millions of lines. Each document is same: 5 fields: 4 strings + 1 integer. All fields should be indexed and searched by. That is: array of 3 ...
0
votes
0answers
126 views

MongoDB Indexes [getting deleted automatically] | Missing

This problem might look strange. Please bear with me :) It's an application(NodeJS - MongoDB) helping with storing and viewing of LoRa Packets. Background: It's a CentOS 7 on Azure Instance. ...
0
votes
1answer
35 views

Mongodb creating historical cluster replicaset

I've a use case which I'm trying to implement.. There is a replicaset(3 nodes) which is primary production cluster, I want to set up a historical cluster another replicaset(3 nodes) which replicates ...
2
votes
2answers
206 views

Mongodb consumes too much RAM during replica resync

I have a mongodb cluster with 2 data nodes and 1 arbiter. I use mongodb 4.0.7 for all my centos VMs. A few days ago one of my servers (lets call it data-2) had a fatal crash and requested a complete ...
0
votes
2answers
334 views

Replica Set in MongoDB by using IPs instead of domains?

I want to use MongoDB in replica-set mode over 2 servers by IPs.But when I deployed the secondary one on other server, I faced the issues about connecting between 2 instance. For example, the primary ...
1
vote
2answers
1k views

How can you view the IP addresses of active MongoDB Atlas connections?

Some posts show you can use db.currentOp(true) to show active connections, but when I do that I get this error { "ok" : 0, "errmsg" : "Using $all for currentOp is disallowed in this ...
0
votes
1answer
317 views

how to set different file system for dbpath in mongodb

how to set different file system for dbpath in mongodb- I have /data1 , /data2 , /data3 file system available for data path, I would like to use given 3 file sy
0
votes
1answer
181 views

Replication or Sharding (MongoDB)

I understand each of the terms but I do not understand very well if they can work simultaneously. In my case, for example, I have a machine with 20GB and I would like to know which is the best ...
4
votes
1answer
877 views

Restore mongoDB by --repair and WiredTiger

We accidentally deleted the directory rm -rf /data/db which was our MongoDB path, and thanks to extundelete, we recovered it and got the directory /data/db. Here are our files in the directory, and ...
1
vote
0answers
46 views

Background index creation resource provisioning

I have a long running background index creation running in MongoDB. However, the CPU and RAM usage is below 30%. Is there a way to allocate more resources to the index creation process or is it ...
0
votes
1answer
261 views

Recover a mongo database deleted by rm

My developer accidentally lost our database by a bash script, which turned out to run rm -rf /* (see this thread). Thanks to extundelete, he just recovered the /data/db/ folder: However, he could not ...
0
votes
1answer
19 views

shard key specification

I have a document like so: { "_id" : ObjectId("52f29f91ddbd75540aba6dae"), "teams" : [ { "name" : "Washington Bullets", "score" : 100, "home" : ...
1
vote
1answer
19 views

Add Secondary to Replica Set in MongoDB Windows

I am trying to add the second replica set to primary. Primary = 192.168.56.52:27017 Secondary = 192.168.56.136:27017 # mongod.conf # for documentation of all options, see: # http://...
0
votes
0answers
36 views

Mongodb covered query executionStats

Hello i'd like some help understanding the following execution stats. For this query db.family.find({ "_id" : ObjectId("5c87890b3adcde7da566f0d7")},{_id:1}).explain("executionStats") "...
1
vote
0answers
101 views

splitting an string in an array into an array Mongodb

I have the current document: { "_id" : ObjectId("5c95b81b10ce2a953215c269"), "name" : "Œufs & Cie", "city" : "Brossard", "state" : "QC", "postal_code" : "J4Y 0G4", "...
0
votes
0answers
29 views

MongoDB: Approach for storing frequently modified references

Need a piece of advice for storing a large number of references between Mongo entities that are frequently updated. Some background: 1 event can have 5000 logs. 1 event can have 10 assets associated ...
0
votes
1answer
23 views

Single collection for multiple keys

I built a little setup with a raspberry pi and a temperature and humidity sensor. Every 5 minutes it reads sensor values and sends them both + a timestamp and a custom ID (there are multiple pis, each ...
0
votes
1answer
81 views

MongoDB specifying shard key and sharding strategy

What is the syntax to state that a collection is to be sharded as location based, while using the range based sharding strategy. I know you have to use the the sh.shardCollection() command, but what ...