Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

What if Priority 0 Replica Set Members got newest oplog

I got a deployment with three nodes: A: priority 2, vote 1 B: priority 1, vote 1 C: priority 0, vote 1 In normal case, A is Primary, B/C are Secondary. Assume the at a time point, B got oplog the ...
sel-fish's user avatar
  • 101
0 votes
2 answers
112 views

mongodb atlas use secondaries to reduce cpu usage

I have M80 atlas cluster(128GB RAM and 32vCPUs) with 3 replicasets. most of the time my system use around 10% of RAM and 10% of CPU, during high load CPU spikes more than 100% leading to autoscaling ...
mahendra's user avatar
  • 101
0 votes
0 answers
52 views

when start the mongos for sharding Getting error

Quickly I giving the details, I have 4 Linux VMs with MongoDB installation. 1. Mongodb is for config so in Mongod.conf file enabled replication with shading like below replication: replSetName: "...
Aravind rajamani's user avatar
0 votes
1 answer
65 views

Why doesn't my MongoDB database start?

Who knows what could be the problem with starting the MongoDB database? PS C:\Users\Yepo> "C:\Program Files\MongoDB\Server\7.0\bin\mongod.exe" --dbpath="c:\data\db" At line:1 ...
Юра Заблоцький's user avatar
0 votes
0 answers
14 views

How can I automate trigger deployment to Mongo Atlas?

I have a couple of triggers on a Mongo Atlas cluster that I want to deploy to a number of databases on a different cluster. Is there any way to do this automatically, through a script or something ...
SQB's user avatar
  • 465
0 votes
0 answers
36 views

Mongo DB community 7.0 on MacOs monterey 12.6

Bootstrap failed: 5: Input/output error Try re-running the command as root for richer errors. Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users/marcus/Library/LaunchAgents/...
marcus's user avatar
  • 1
0 votes
0 answers
7 views

How to consult the number of connections from specifics clients or ips in my secondary nodes

I need to know how to consult the number of connections from specifics clients or ips in my secondary nodes, I have a replica set composed of 3 nodes (one primary node and two secondary nodes), the ...
miguel ramires's user avatar
0 votes
0 answers
75 views

Restoring Mongodb database in Windows by using dump taken from Ubuntu server

I have taken a dump from Ubuntu v20 server using mongodump. I need to use it on my Windows laptop. In my Windows laptop, a. from which directory should I execute the mongorestore command? b. where ...
hemant's user avatar
  • 101
0 votes
2 answers
65 views

The effectiveness of compound index where the prefix is continuous / high cardinality

schema: { time_utc: "milliseconds", city: "string", age: "integer" } index: { time_utc: 1, city: 1, age: 1 } sample query: col.aggregate([ { $match: { ...
Bear Bile Farming is Torture's user avatar
0 votes
1 answer
22 views

In Mongo 2.6, how can I tell if there are any IP based restrictions?

I have a mongo v2.6.12 cluster that I can't connect to from a new windows machine. Using TNC I've confirmed that port 27017 is accessible from the source -> destination. How can I tell if there ...
Chris Rockwell's user avatar
0 votes
0 answers
188 views

Mongo Upgrade 4.4 to 5

I am trying to upgrade mongodb standalone ver 4.4.22 to 5. I have stopped the services, made the /etc/yum.repos.d/mongodb-org-5.0.repo directory, installed the yum packages with sudo yum install -y ...
datascinalyst's user avatar
0 votes
0 answers
14 views

Advice on MongoDB data modelling

I have a schema written in mongoose, I want suggestions on how to improve this schema to scale. members: [{ user: { type: Schema.Types.ObjectId, ref: 'User', }, roles: [...
Badri's user avatar
  • 1
0 votes
1 answer
33 views

Why use $group / group_by instead of multiple requests?

Let's suppose that there are 100 types of dogs scattered across the documents of my collection. If I need to group by types of dogs and then compute some aggregate statistic about each type of dog, ...
Bear Bile Farming is Torture's user avatar
0 votes
0 answers
42 views

Mongodb database hosting limitations and options

So I'm currently working on an application in node js and I'm using mongodb as the database for the server, it all went well until I got to the point of hosting the database. I've came across mongodb ...
Binus's user avatar
  • 1
0 votes
2 answers
47 views

MongoDB account -- is it an administrator's account?

I'm more familiar with MySQL, but in my new workplace, I have to look after a MongoDB database (MongoDB 4.2.18 with Mongosh 1.1.9 running on Ubuntu 18.04.6 -- yes, it's old; upgrading is a problem for ...
Ray's user avatar
  • 113
0 votes
0 answers
28 views

MongoDB indexing for dynamic query

I'm trying to build a query optimizer for survey response data, all questions are stored in a collection and have some fields are number_of_selection, option_marked etc. Now I'm trying to build a ...
Deepak Kumar's user avatar
0 votes
0 answers
33 views

MongoDB set field in array of embedded documents to value of another field

Within my document I have an array of embedded documents. I want to set the value of one field from one of the documents in the array to the value of another field, outside the array but in the same ...
Voldrix's user avatar
0 votes
0 answers
21 views

Find document with regular expressions in collections related to populate in mongoose

The aim is to filter a collection of documents (Requests) based on the document field from another collection (Patients, Clients, Doctors, and Services), of which there are several references in the ...
Izlia's user avatar
  • 101
0 votes
0 answers
219 views

mongodb replication Flow control is engaged and the sustainer point is not moving

In a 3 node replica set (no sharding): at present  p1 - secondary p2 - primary dr - secondary When I connect using mongsh on each of those nodes - On p1 : mongosh <--all-envs> --port 7253 ...
unknown's user avatar
  • 94
0 votes
0 answers
25 views

MongoDB: Complicate aggregation operation speed optimization

We want to calculate the average weight reduced and total weight loss users according to scales collection. The following steps describe our aggregation: Firstly, we calculate the average weight for ...
Hhry's user avatar
  • 111
0 votes
0 answers
131 views

Need Help: MongoDB Startup Failure - Seeking Solutions and Advice

sudo systemctl start mongod Job for mongod.service failed because the control process exited with error code. See "systemctl status mongod.service" and "journalctl -xe" for ...
Fardeen Kachman's user avatar
0 votes
0 answers
105 views

Mongodb setup replica set in parallel on same server

I would like to know how to proceed to deploy a mongodb replica set environment on my servers where, in turn, other mongodb instances are already running, the following happens: I have a mongodb ...
miguel ramires's user avatar
1 vote
2 answers
596 views

Assigning multiple IP addresses to MongoDB 7.0 on Ubuntu

The Problem I am trying but failing, in MongoDB 7.0, on Ubuntu, to bind multiple IP addresses to net.bindIp in mongod.conf What I have tried I have tried 127.0.0.1,x.x.x.x, 127.0.0.1;x.x.x.x, [127.0.0....
Yenmangu's user avatar
0 votes
0 answers
214 views

MongoDB 'not authorized on DATABASE to execute command' when not using MongoDBCompass

I'm trying to access data from a MongoDB which the database administrator has given me limited access to. The db admin has allowed me to access a specific document and collection within the db. For ...
AccDa's user avatar
  • 11
0 votes
0 answers
42 views

why mongodb does not create chunk for a sharded cluster?

I had a mongo instance running that was the only node in its replicaset. It had about 33G of data. Now I added 2 other shards each only one node in their replicaset and added them to cluster using db....
Ssaf's user avatar
  • 1
0 votes
0 answers
39 views

Storing Aggregation pipeline inside materialized view in Mongo

I am quite new to Mongo Coming from Sql background. I have a aggregation on collection_1 which involves $graphlookup (given below) [ { $match: { $or: [ { objStatus: "...
Arun's user avatar
  • 13
0 votes
0 answers
16 views

How to Auto sort on one field in MongoDB?

I am new to the MongoDB database. Because the number of records is very large, it takes us a lot of time to sort them in each query. I want to have a field called Id, like in SQL server, that I can ...
hmahdavi's user avatar
  • 107
0 votes
0 answers
171 views

How to add a virtual field to mongoose array of objects in a schema?

I have a mongoose schema as follow const mongoose = require("mongoose"); const PostSchema = new mongoose.Schema( { title:{ type:String, required: true, trim: ...
Ajith's user avatar
  • 101
-1 votes
2 answers
85 views

How to index when the fields used in the query is unpredictable?

In collection A, each document contains up to 100 fields. The database, mongoDB, only allows up to 64 indexes on a single collection. Indexes are needed for a query on this collection. The filter, or $...
Bear Bile Farming is Torture's user avatar
0 votes
1 answer
64 views

Mongoexport for Thousands of Collections

There is a database that consists of thousands of collections, and we want to export and import those collections. Also, this will be between different MongoDB versions, so we cannot use mongodump and ...
Samet Turgut's user avatar
0 votes
0 answers
37 views

Mongo 3.4 to 3.6

How to upgrade 3.4 mongo to 3.6 mongo. I don't have config file while starting mongodb in 3.4 how to have it in windows locally.
Elango Van's user avatar
0 votes
0 answers
45 views

MongoDB replication fails around 1900 GB with error-Too many open files

My MongoDB replicaset running in cloud and onprem on version 2.6.12. The replication between the two is failing everytime it reaches around 1900 GB. I have tried the below steps but the replication ...
Abhinav Kumar's user avatar
-2 votes
1 answer
30 views

Solution to query that must examine all rows / documents in worst case

The logic of my query goes like this: Filter documents based on arbitrarily many and non-predetermined fields. The filter conditions can total to hundreds. But the worst case is that there are no ...
Bear Bile Farming is Torture's user avatar
0 votes
1 answer
32 views

Sharding collections across different servers versus the same server

I understand that a collection can be sharded across a cluster. Does this mean that each shard is guaranteed to live on its own hardware server? Or could multiple shards share the same hardware? If ...
Bear Bile Farming is Torture's user avatar
1 vote
0 answers
347 views

Connection timeout from host MongoDB compass to docker mongo replication

docker-compose file: version: '3.8' services: mongodb-primary: image: mongo:latest hostname: mongodb-primary container_name: mongodb-primary ports: - "27018:27017" ...
Alireza's user avatar
  • 3,636
0 votes
0 answers
222 views

error while creating a composite index

I work on a mongodb database where I have a request that does collscan to optimize the operation to IXSCAN I tried to create a composite index ,with the following syntax db.person.createIndex({"...
Abdallah Mehdoini's user avatar
0 votes
0 answers
404 views

How to determine why mongodb stops with "signal":15,

I'm running mongodb 6.08 on an AWS linux t2.2xlarge instance. A parallel process is communicating with the database with 8 processes running in parallel. Now and then a signal 15 error stops the ...
conteh's user avatar
  • 101
0 votes
0 answers
54 views

How to create replica set of mongodb in ubuntu and enable it?

I am using MongoDB community edition in Ubuntu 22.04. How can I make replica set in my local machine and how can I enable it to use in my node js application?
user avatar
0 votes
2 answers
107 views

How to handle two separate databases? MongoDB and PostgreSQL

We currently have a Postgres database which acts as our core/primary database for our web platform. This database stores registered user accounts (people who have signed up for an account on our site) ...
AccDa's user avatar
  • 11
0 votes
0 answers
115 views

Primary mongo node still trying to reach arbiter after removing it

we faced issue regard replication of MONGO replicSet on production so I rebuild the replica set by deleting the local DB and initate it again with just primary node so production application can be up ...
Alaa Mohsen's user avatar
0 votes
1 answer
39 views

mongod binary path is not obtained by "db.serverStatus().process" on Ubuntu 20.04

I am unable to get mongod binary path using "db.serverStatus().process" on Ubuntu 20.04. I need to incorporate this command in a script. But "db.serverStatus().process" gives just '...
satya's user avatar
  • 11
-2 votes
1 answer
141 views

Understanding $dateAdd/$dateSubtract behavior in mongodb

I'm trying to understand why $dateadd works with $expr but not without: This code returns result set: db.getCollection("CollectionName").aggregate( [ { "$sort" : { ...
Michael Cherevko's user avatar
0 votes
1 answer
25 views

Is it possible to use Mongo's Ops Manager with a DocumentDB instance on AWS?

We currently use Ops Manager to manage our on-prem MongoDB instances. We are, however, moving toward using native AWS services instead. As such, we are looking to use DocumentDB with our newer ...
Michael Oryl's user avatar
1 vote
0 answers
43 views

MongoDB RBAC limitations

I'm researching if MongoDB is the solution for my problem of storing schema-less data for multiple users. Let me sketch the problem: I've got a lot of users (100k) and want to have some place for ...
Ron Nabuurs's user avatar
0 votes
0 answers
21 views

How to create zones in mongodb

i have deployed a shard cluster with 2 shard replica sets and i want shardA replica set primary in one zone and secondaries in another zone same way shardB replica set primary in one zone and ...
Durga prasad's user avatar
1 vote
1 answer
327 views

Mongodb replicaset allow secondary to write data

I'm having some trouble to understand how replicaSet works using 2 nodes and a arbiter, using MongoDB 6 community in 3 servers with ubuntu 22.04. My actual scenario is I have 2 servers in a replicaSet ...
Rafael's user avatar
  • 113
0 votes
0 answers
16 views

How to upgrade MongoDB 3.6.9 to 4.0 series in different Server

What are the steps for installing and upgrading MongoDB on a remote server that is either a sharded cluster or has a split configuration? Additionally, how can I establish a connection between MongoDB ...
zirach's user avatar
  • 1
0 votes
1 answer
28 views

MongoDB how can we have all the admin privileges plus restriction to access the data inside the database

We need to know how we can restrict having access to MongoDB even when we have admin access. we as devops create MongoDB then we get admin access, using these admin access we can see data in all ...
Charmi's user avatar
  • 1
0 votes
0 answers
51 views

Why MongoDB getting higher memory usage?

This is the sample Python code that I used to write data in MongoDB database. After every connection close, I restart the program and I noticed an accumulation in memory count in the Task Manager. ...
Thiwanka Gunasinghe's user avatar
0 votes
0 answers
10 views

Troubleshooting high Document Metrics in MongoDB Cloud Manager

I am troubleshooting an incident where we receive a spike in document metrics during the incident according to MongoDB's cloud manager. Does anyone know what are some possible causes for this? Other ...
Khoa Bui's user avatar

1
2
3 4 5
49