Questions tagged [mongodb]
All versions of MongoDB - a scalable, high-performance, open-source, document-oriented database.
2,383
questions
0
votes
1
answer
24
views
Possible options for SQL and NoSQL combination for social media data
I have searched this forum for an answer but could not find anything relevant. We are designing database schemas for a social media app with posts, groups, users and chats etc and it looks like we ...
0
votes
0
answers
11
views
mongodb sharded cluster upgrade to 4.4
we had a mongodb sharded cluster of version 3.6. we updated this cluster to 4.0 and 4.2 respectively. then we upgrade the cluster to 4.4 based on the docs.
the problem is when we are doing the last ...
-1
votes
3
answers
56
views
Should i care about field names in JSON datatypes?
In DBMSes like MySQL, MariaDB, PostgreSQL and MongoDB, data is saved as BSON, JSON or JSONB for JSON columns or document.
All of these data types use space for key names in JSON.
Does internal data on ...
0
votes
1
answer
20
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 ...
0
votes
1
answer
38
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 ...
0
votes
0
answers
18
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: "...
0
votes
1
answer
27
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 ...
0
votes
0
answers
4
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 ...
0
votes
0
answers
17
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/...
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 ...
0
votes
0
answers
17
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 ...
0
votes
2
answers
37
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: { ...
0
votes
1
answer
15
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 ...
0
votes
0
answers
72
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 ...
0
votes
0
answers
13
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: [...
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, ...
0
votes
0
answers
39
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 ...
0
votes
2
answers
26
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 ...
0
votes
0
answers
23
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 ...
0
votes
0
answers
19
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 ...
0
votes
0
answers
12
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 ...
0
votes
0
answers
92
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
...
0
votes
0
answers
19
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 ...
0
votes
0
answers
62
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 ...
0
votes
0
answers
57
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 ...
0
votes
1
answer
226
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....
0
votes
0
answers
97
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 ...
0
votes
0
answers
30
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....
0
votes
0
answers
21
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: "...
0
votes
0
answers
14
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 ...
0
votes
0
answers
108
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: ...
-1
votes
2
answers
63
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 $...
0
votes
1
answer
38
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 ...
0
votes
0
answers
29
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.
0
votes
0
answers
37
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 ...
-2
votes
1
answer
29
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 ...
0
votes
1
answer
22
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 ...
1
vote
0
answers
198
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"
...
0
votes
0
answers
85
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({"...
0
votes
0
answers
151
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 ...
0
votes
0
answers
34
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?
0
votes
2
answers
82
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) ...
0
votes
0
answers
70
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 ...
0
votes
1
answer
36
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 '...
-2
votes
1
answer
71
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" : {
...
0
votes
0
answers
17
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 ...
1
vote
0
answers
32
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 ...
0
votes
0
answers
17
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 ...
1
vote
1
answer
137
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 ...
0
votes
0
answers
14
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 ...