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

Can we replicate or restrict specific databases in MongoDB

In MySQL, we are having replicate-do-db/replicate-ignore-db during replication, where we can replicate or restrict specific databases from Master to Slave. In the similar way, is there any specific ...
0
votes
1answer
31 views

MongoDB Fragmentation affect the Performance in WiredTiger

Im using MongoDB 3.6 I have a huge number of fragmentation in my collections. 300+ GB on one collection. WiredTiger is the storage engine. I know its bad for the OS and much wasted space. This ...
0
votes
1answer
37 views

Can't migrate standalone MongoDB to Cluster

I'm trying to convert a standalone MongoDB database into a cluster in order to migrate my database to MongoDB Atlas. I've followed the following steps to try and convert it: Stop my mongodb instance ...
-1
votes
1answer
20 views

Trouble designing mongodb 1-many collection/query that could grow without bounds

So in an application I'm currently working on, I'm having an issue designing a collection. I can't give away too much information about the application, but here is a similar (albeit not as realistic) ...
0
votes
1answer
18 views

MongodB cumulated conditionnal array:using map/reduce or aggregation

First, I aplogized because I have some problem to formalized my question so any idea on express it correctly will be appreciated and edited. Last try: How to get last of a cumulated conditionnal ...
1
vote
1answer
37 views

MongoDB Shell support for map.set()

I am trying to use the MongoDB shell to run some scripts. Inside the JavaScript I am attempting to run var map = new Map() then map.set(1,1). However, I am getting the following error: E QUERY [...
0
votes
0answers
26 views

Mongodb doesn't respond

We have a sharded cluster with 3 shards. The version is: 3.6.13. The users of the prod. database (1,8 TB sized) complain about an issue. System works normally but after sometime it stucks and doesn't ...
0
votes
0answers
20 views

MongoDB connection initialisation delay on certain Windows 10 devices

System info OS Name: Microsoft Windows 10 Enterprise OS Version: 10.0.17134 N/A Build 17134 MongoDB Version MongoDB 4.2.1 x64 Windows. Overview When forming a ...
1
vote
1answer
27 views

Mongodb automatic Replica Set creation with JS driver

The MongoDB docs state that one can use the mongo client console to initialize replica sets by running rs.initiate([config]). However, I don't want to have to manually use the command line for this. ...
2
votes
1answer
32 views

Mongodb: how to create multiple indexes on same field?

For example, I created this index: db.test.createIndex({field1:1}, {partialFilterExpression:{field2:{$gt:10}}}) Index created successfully. Then I want to create second index: db.test.createIndex({...
-2
votes
1answer
48 views

How sharding of databases effect ACID property or transactions?

MySQL (and other Relational Databases) are known to be ACID compliant with respect to transactions. However, when databases are sharded, does the ACID property of transactions break since now ...
0
votes
0answers
39 views

mongod log ms meaning

I cannot understand from reading the documentation what is the meaning of the ms in the mongod.log at the end of the following line: 2019-10-30T21:09:41.647Z I COMMAND [co48] command Db.noa ...
0
votes
1answer
39 views

We use MongoDB 3.6 community version, How can i get the number of hits on single collection as well as bandwith usage?

Is it possible to get the number of hits on single collection as well as bandwith usage in mongodb ?
2
votes
1answer
18 views

MongoDB map-reduce impacts insert performance on source collection

I have a "hot" MongoDB(4.0.5) capped collection with a timestamp (and several other) indexes. Many applications (Java, NodeJS & C++) insert (never update) records into this collection at a rate ...
1
vote
0answers
13 views

What will be the behavior of mongodb under this partial network partition

Consider a shard cluster: Has only one shard, but the shard has 3 replicas A, B, C Has 3 mongos instances mongos and mongod instance are running across 3 different data centers. The primary node (A) ...
0
votes
1answer
42 views

Upgrading Mongodb from 3.2.6 to 4.2. Which is the better way to do it?

What is the best way to upgrade MongoDB? Say I have 3.2.6 and I want to upgrade to 4.2 Can I just use mongodump and mongorestore? Or are there any intricacies to it?
1
vote
0answers
54 views

How to connect mongodb from aws ec2 ubuntu docker containers?

I have tried mongosqld --addr localhost:3002 --mongo-uri xxxxx.com:27017 But it is throwing the following error: unable to load MongoDB information: failed to create admin session for ...
1
vote
0answers
16 views

Mongo Replica Set x509 Membership Setup

I have a MongoDB 4.2.1 replica set, that I am trying to setup x.509 membership as documented here https://docs.mongodb.com/manual/tutorial/configure-x509-member-authentication/ In doing so, I get ...
0
votes
1answer
29 views

How to get the last 10 query run on MongoDB?

I am using mongoose driver in my Node.js app and I want to know what queries mongoose run behind the scene when I call available function on mongoose model. e.g. I am saving a signup information for ...
1
vote
1answer
29 views

Migrating from MongoDB Atlas to self managed Mongo (EC2) server

There is an abundance of info about migrating TO Atlas but not too much I could find specifically about going the other direction. I am migrating a collection which is 250GB in size. I have tried ...
0
votes
1answer
22 views

mongorestore - documents fail validation

The similar question already have been asked: How to validate a mongorestore But how to actually validate the documents in mongodumb and mongorestore? And also - can I see the documents that fail ...
1
vote
0answers
36 views

How to handle databreach? [closed]

what is the immediate action to be taken from a Mongodb dba when we come to know our data is compromised or open to public without our knowledge. what are the actions to be taken immediately so that ...
0
votes
1answer
33 views

Why is MongoDB user with the only privilege as “find” able to insert and update collection?

I want my user to have only find action privilege on a specific collection. However, when I create the user with the privilege, restart the mongod server and run the mongo shell again with -u -p and --...
0
votes
1answer
23 views

Why is it necessary to run both mongod and mongo.exe in windows? What's happening behind the scene?

Why is it necessary to run both mongod and mongo.exe in windows? What's happening behind the scene? What's the difference between these two?
0
votes
1answer
63 views

Mongo: mongodump and the config database error

I've setup a backup script on my Ubuntu box using mongodump. However this currently doesn't work because of an error when attempting to dump the built in config database: (Apologies for the image, I ...
0
votes
1answer
28 views

how mongo db does locking for updates/inserts?

I have many data for each user that with write heavy and many for each separate users that there is not any relation between user's data; so there is two options for me to store them: 1. keep all user'...
1
vote
0answers
225 views

UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6;

Kindly assist me on following upgrade issue. My Arbiter upgrade (thru yum update -y ) has been failed with following error. 2019-10-19T07:19:25.944-0400 I CONTROL [initandlisten] 2019-10-19T07:19:...
0
votes
0answers
23 views

Mongo primary failover causes rollback

I have a replicaset that processes largish batches of inserts (a few million) every night. Last night, the primary failed over and went into a rollback state. All clients which access this replicaset ...
0
votes
0answers
13 views

what to pass as a key instead of username and password for anonymous users @login?

i am trying to make a mongodb schema in which i am allowing the person to publish projects anonymously, i already have the authenticated user schema and i am thinking of using that only to allow ...
0
votes
0answers
69 views

MongoDB - Setting up the MMS Automation Agent

I am currently trying to set up a testing environment that includes 3 MongoDB database deployments and one server with an installation of the MongoDB Ops Manager. I succesfully installed the MongoDB ...
1
vote
1answer
233 views

mongodump fails after exactly 10 minutes

Using single instance MongoDB v4.2.0 on Debian 9.11 with collection of 78GB and 60M documents on a 2 vCPUs, 13 GB memory server. This command is invoked on the same server where database runs: ...
0
votes
0answers
125 views

Error: Could not find host matching read preference { mode: “primary”, tags: [ {} ] } for set Cluster0-shard-0 :

I am trying to connect to the class Atlas cluster. In the cmd shell, running this command: mongo "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:...
0
votes
0answers
21 views

Issue in projecting field using findOneAndUpdate in embedded array Mongoose?

Currently my User model looks like: { _id: 'SomeId' firstName: 'John', lastName: 'Cena', books: [ { _id: 'xyz', title: 'a', author:'b', ratings:[ {source:'source1', ...
1
vote
0answers
55 views

Why did mongoDB reads from disk into cache suddenly increase?

This is a mongoDB replica set with 1 primary, 1 secondary and 1 arbiter. Suddenly the reads from disk into cache and cache page evictions increased 2x-3x and stay elevated since then (all metrics ...
0
votes
0answers
37 views

MongoDB: Lost dry run election due to internal error

I am trying to solve a Replication issue here in MongoDB 4.2, but I can no longer get my Primary server back to primary, it always stays in SECONDARY mode. I've tried several types of solutions, like ...
0
votes
1answer
161 views

MongoDB - Can I create TTL index with rolling method

Im getting stuck with archiving a huge amount of data in MongoDB 3.6 I want to delete 56 crore records in a collection. I tried to remove using bulk.remove(), but that is also slow.(50 records are ...
1
vote
1answer
33 views

Mongodb - Best Practice for TTL index on huge dataset

I want to create a TTL index for a table. Table size 1.2TB I have a shard infra. Each shard is having 3 node replica set. For creating this index, can I go with the rolling index creation method? ...
2
votes
1answer
56 views

Mongodb - Will Bulk.find.remove() lock the collection

I'm planning to run Bulk.find.remove() on a very big collection. (1.2TB). Will it block inserting or updating other records (which are not a part of the above find)?
2
votes
0answers
29 views

MongoDB best backup Practices [closed]

I have the following questions to ask: What are the best practices for MongoDB backup Is mongodump a good option for data greater than 50GB? Does mongodump have any adverse effect on mongodb while it ...
0
votes
0answers
25 views

How to control dirty pages eviction threshold percentage in mongodb server settings?

I have a scenario in which I only insert documents to the MongoDB database. I'm aware that by default, once 5% of WiredTiger memory pages are dirty, MongoDB would start evicting the dirty pages. In ...
2
votes
1answer
241 views

Failed to restored indexes using mongorestore - MongoDB

Note: I already know about --noIndexRestore I have an org collection with the following document structure, { "_id" : ObjectId("5cc2bf9f5ca45131b8f8e427"), "name" : "National", "parent" :...
0
votes
0answers
22 views

MongoDB Move data to another shard

I have a MongoDB with 3 shards: A, B, C. B's disk is full so everytime I start mongod it eventually stops. However, A and C still have GB of space. Hiring a new server with more space than B and ...
-1
votes
1answer
25 views

Database are not visible to users who has access in MongoDB

We are using Robo 3t tool to interact with Mongodb. We could see the user has read access on 2 databases but when the user is connected to MongoInstance that databases are not visible to the users. ...
0
votes
0answers
42 views

MongoDB uneven document sharding - and Migration Windows

I created a sharded mongodb cluster with 2 shards. Then I created a sharded collection by range and inserted 10000 documents with random documents with random values for the sharded key using Java. ...
1
vote
0answers
45 views

MongoDB slow search in array with $all multiple conditions, even with index

I have a mongodb collection with about 100.000 documents. Each document has an array with about 20 elements. The array looks like this: features: [ "0_Toyota", "29776_Grey", "...
4
votes
0answers
131 views

How can I reduce time spent acquiring the mongodb schema lock?

We have a mongodb 4.0.10 cluster, backed by WiredTiger, in production, with a 3 node replica set consisting of a master and two slaves. One of the slaves has another service co-located that queries ...
0
votes
0answers
16 views

How to show the execution log use Mongo-go-driver

I want to check that my Mongo query statement is correct. So, how to display mongo's query command use Mongo-go-driver?
0
votes
1answer
25 views

Up to sync new members in replica set

Let's say I have 2 nodes in my replica set with an arbiter running. Now when it comes to adding a new member to an existing replica set while it is still running for production, what steps do I need ...
0
votes
1answer
52 views

Scaling Users in MongoDB

Our team has been tasked with a fairly open ended request for a MongoDB with multiple users that can access and submit documents to collections for a graduate class. The team is all new to MongoDB and ...
0
votes
1answer
24 views

Mongo DB Upgrade 3.0 to 3.2 Verification of Upgrade

We have a few environments with MongoDB 3.0, these are standalone servers. These servers are already using WiredTiger Storage engine. I am trying to upgrade them to 4.2. As per the upgrade ...