Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
-1
votes
0answers
16 views

find a problem into mongodb cpu usage in mongodb atlass

Since a few days ago, resource usage of the database has increased a lot when we don't have a new query is added to the system I am asking for help on how to solve the problem And, I received the ...
0
votes
2answers
17 views

Does the order of MongoDB search terms matter for query performance?

Does the order of search terms in MongoDB matter? I came across this documentation from learnmongodbthehardway that cautions against the use of $ne and $nin: If you need to use these [$nin and $ne] ...
0
votes
0answers
9 views

Too many MaintenanceTimer and CleanCursors Threads

I am using jconsole to check for the number of threads and I see a lot of MaintenanceTimer threads and CleanCursor threads. What are these threads? Is it related to any mongodb configurable options? ...
0
votes
1answer
12 views

filter for elements inside an array

"dammfield" : [ { "_id" : ObjectId("60705d602ba9490026482370"), "f1" : ISODate("2021-04-09T10:57:52.152-03:00"), ...
-2
votes
0answers
28 views

Transform mongodump archive to BSON

I have a 2 TB gzip file that was created from a mongodb 4.2.6 instance using mongodump with the --archive and --gzip flags. I do not have access to this database nor do I have access to a MongoDB ...
0
votes
1answer
27 views

Do any pattern exists for renaming live a MongoDB collection?

Do any pattern exists for renaming a MongoDB collection live in production environment? The collection is accessed both for reading and for writing in a non sharded environment. The requirement is to ...
0
votes
1answer
24 views

Get the list of all the users of all the databases using pymongo

db.command('usersInfo') The above command gives the list of users in the database in which the command is run. command_result = db.command( { 'usersInfo': {'user': 'user', 'db': '...
-3
votes
1answer
16 views

How to arrange documents in a collection alphabetically in mongodb?

How do I arrange my document names in a collection alphabetically and henceforth make my searches for a particular document faster? Say I have a million documents in a collection. I want to search for ...
0
votes
1answer
21 views

Concerns with Frequent Updates in MongoDB

I am trying to maintain near real-time digital twins of IoT devices. Some research has pointed to Eclipse's Ditto framework built on top of a MongoDB database. Being unfamiliar with database ...
0
votes
0answers
36 views

Can I assume that all databases will return a promise? [migrated]

I am designing a set of unit and integration tests with a friend of mine, and we had a doubt. We know the answer, at least, what is more likely to be true. However, we would like to hear your thoughts....
0
votes
2answers
65 views

for mongo, not able to create users other than admin with error command createUser requires authentication :

This is the script I am using to create user accounts in MongoDB: mongo <<EOF use admin; db.createUser({user:ram", pwd: "ram123!", roles:['root']}); db.createUser({user:"sam&...
0
votes
0answers
9 views

Will rand string as custom _id make B tree index split higher frequency in MongoDB?

In the answer to the question Are there any advantages to using a custom _id using MongoDB? you can make them more human-friendly, using random strings: t3oSKd9q For the B tree, random key inserts ...
0
votes
0answers
12 views

Backend Server gives Mongo Error not authorized for query on mongo_db.tb_trx when primary is unavailable and Secondary Replica gets elected to Primary

Using mongodb with replica sets, when the primary node fails, one of the secondary gets elected to the primary but the node servers start to throw error Mongo Error not authorized for query on ...
-1
votes
1answer
12 views

Search with mongodb [closed]

Im learning mongodb and Im starting the searching commands but looking for an example i found this db.amigos.find({Nombre: "Marisa" },{Nombre:1, Apellidos:2}) What does :1 and :2 means?
0
votes
2answers
58 views

How to copy MongoDB database from server to local machine?

Or just may be dump database on to the folder on the server and then scp it to local machine? I'm trying to use mongodump from /usr/bin, but nothing good comes out of it, for instance: mongodump --ssl ...
-1
votes
0answers
26 views

Where does the top command gets its results from?

while I was troubleshooting an issue with my monitoring system I've noticed that the output of the TOP adminCommand contains almost 17k collection names; some are actual collections, many others seem ...
0
votes
2answers
27 views

Is there an automatic way for a secondary member to promote to primary member in a replica set?

Here is my setup: Node 1 = 10.1.0.1 (Primary) - priority 1 Node 2 = 10.1.0.2 (Secondary) - priority 1 Node 3 = 10.1.0.3 (Secondary) - priority 0 In the event of Node 1 failure, Node 2 will be set to ...
0
votes
2answers
43 views

how to disable access to mongo shell to anonymous users?

i have created users in mongodb . one user among them is admin. but when i do $mongo it is allowing me to connect to mongo shell with out me specifiying user and password. what should i do to prevent ...
0
votes
1answer
40 views

MongoDB: F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open “/data1/mongodb/log/mongod.log”

I am trying to install mongodb 3.4 on Redhat 7.9. When I start mongodb systemctl start mongod I get the below error FileNotOpen: Failed to open "/data1/mongodb/log/mongod.log, But when I start ...
0
votes
1answer
51 views

Map-Reduce on `system.profile` collection

I have a simple collection posts with a few documents in it. I have set the profiling level to 2 allowing for profiling information to be collected into another collection system.profile. My goal is ...
0
votes
0answers
37 views

How to speed up the mongo query for getting the min and max values in range?

I have a simple collection that contains two fields: timestamp and value (float). I need to get min and max values in the timestamp range. The collection contains approx 10000000 documents. I've add ...
0
votes
0answers
13 views

PostgreSQL for user management and another database for file management (Blob storage)

I am working on a project with video hosting and online editing platform with a microservice architecture in mind. One of my teammates uses PostgreSQL SQL for user management, but I need to handle ...
0
votes
1answer
629 views

mongod.service: Failed with result 'exit-code'

I'm trying to run mongodb server : sudo systemctl start mongod this gives me no error, but when I try to check the status, I get error saying : mua@mua  ~  sudo systemctl status mongod ...
0
votes
2answers
146 views

“[ftdc] serverStatus was very slow” - MongoDB 4.0.4

I'm seeing very frequent messages like this in mongod.log and doesn't give an exact reason for the server status was very slow. looks like ftdc logs more information but interpreting ftdc log is very ...
0
votes
1answer
22 views

Zoned and hashed sharding of existing, non-empty collection

I am trying to shard a existing collection. Collection is pretty big (about 100gb). Sharding should be done by 2 fields. First one is zone ['Europe', 'America'] and second one is _id. So my sharding ...
0
votes
3answers
40 views

How to structure db where main records are large

I was wondering if I could ask for some quick opinions. I am prototyping an app which seems simple but I can’t readily arrive at an architecture that feels right. We have data that is simple and fits ...
0
votes
1answer
129 views

Standalone Mongodb suddenly failed and I'm unable to recover. Backups are also corrupt

Running on FreeBSD/ZFS for several months, users reported trouble. At this point I'm out of options so any help is apreciated. The database backs a Node.js based authoring tool with a couple of users, ...
0
votes
1answer
16 views

Does mongo *really* need a dedicated volume, if I need to back it up?

TLDR; What's the easiest way to automate a mongodb backup of a 20-gig DB? We run mongo on the same KVM (VPS) as the web app; the server runs Debian. We/I don't need/want to backup the entire fs on a ...
1
vote
0answers
22 views

MongoDB latency decreases as throughput increases

I am trying to benchmark MongoDB and obtain a throughput vs. latency plot. I am using YCSB as the client and I increase the number of client threads to increase the load on the database. I ...
0
votes
0answers
22 views

What's the easiest way to automate Mongodb backups, for offline storage? [duplicate]

So, I'm almost finished building my first major production web app, and am wondering how to manage backups. Weekly cold snapshot backups via my vps online admin seem ideal - but weekly downtime sounds ...
0
votes
0answers
22 views

Can MongoDB support TTL per document, not per index?

I am trying to do a Redis-like collection in MongoDB. I need a collection of documents that expire and are automatically deleted after a certain time. I can use TTL Indexes but with this, every ...
0
votes
0answers
7 views

Modify number of file WiredTigerLog in mogodb

How can I modify the number of WiredTigerPreplog and WiredTigerLog in journal directory ? There are allways 2 WiredTigerPrepl and 1 WiredTigerLog. Thanks MongoDB : "version": "4.4.4&...
0
votes
1answer
22 views

Rename all databases when doing a mongorestore?

I have a datadump but I need to change the name of every database while restoring them, if a database is named "customers" it needs to be "customer2", "products" to "...
0
votes
2answers
28 views

Unable to start mongod daemon after upgrading OS from Ubuntu 16 to 18

Unable to start mongod daemon after upgrading OS from Ubuntu 16 to 18 root@dummy2:~# mongod --version db version v4.0.4 git version: f288a3bdf201007f3693c58e140056adf8b04839 OpenSSL ...
0
votes
1answer
7 views

Mongodb migration and appending data to existing database

I have two databases in two different machines containing data in same schema. Both have relational mappings in form of ObjectIDs as it is done in NoSQL database. The task at hand is to pick one ...
0
votes
1answer
33 views

how to mongorestore mongoDB 4.2 to documentDB 4.0?

I need to do mongorestore from my mongodb 4.2 to DocumenDb 4.0 compatible i got the command from aws which is this mongorestore --ssl --host="abc.aws.com:27017" --username=user --password=...
0
votes
1answer
9 views

threshold replica lag for secondaryPrefered mongod

Example: 3 node on RS with mongos and mongoc(cluster) On one Secondary node(on RS) we have replica lag, e.g. - 1h. So, if my read preference is - secondaryPrefered and if I read data from RS, can it ...
0
votes
0answers
10 views

Mongodb Downgrade issue

I have upgraded mongodb to 4.4 from 4.2 in our dev server(RHEL 8). But unable to downgrade it from version 4.4 to 4.2 (Tried after changing package /etc/yum.repos.d/mongodb.repo). Getting error ...
0
votes
0answers
19 views

Why does the size of fields in a collection in mongodb database affect query performance?

I had a collection that was growing and with it's growth had a crazy increase in query response times. The collection records looked something like this: { orderStat: { type: String }, items:...
0
votes
2answers
45 views

mongo db-Either all host names in a replica set configuration must be localhost references, or none must be; found 1 out of 2 [closed]

while adding secondary member in replica set, i get following error: "Either all host names in a replica set configuration must be localhost references, or none must be; found 1 out of 2" my ...
1
vote
2answers
41 views

Nosql vs sql for genre management

I'm looking to keep a simple database for movies, with details like Name, YearofRelease, Genre etc. The key factor is the genres entry, where a movie could fall into multiple genres. Using a sql based ...
0
votes
0answers
11 views

My Mongos can't authenticate to my replica set

I have 3 config servers in a replica set and when I use the command: sudo mongos --configdb crs/the 3 config servers:port# --keyfile "Keyfile", I keep getting this error: [mongosMain] Unable ...
0
votes
1answer
78 views

mongodump failing to connection replica set

I'm able to connect to secondary node from arbiter node of the replica set. mongo -u backup02 -p backup02_password --port 8133 --host p1dummy:8133,p2dummy:8133,drdummy:8133 --authenticationDatabase ...
0
votes
1answer
29 views

what will happen if MongoDB primary host is down and secondary is out of sync. will we lose transaction?

In our environment, we have one primary(A) and two secondaries(B & C nodes) running in Mongodb 4.0 version. secondary(C) server is newly added and sync is happening on that. Cluster is running ...
0
votes
0answers
28 views

Why mongodb's storage size is larger on secondary than on primary?

I don't understand why the storage size is significantly larger on the secondary than on the primary (450 GB vs 375 GB). hardware, operating system, file system and mongodb configurations are ...
0
votes
1answer
26 views

How to warm a MongoDB index

We're running a huge MongoDB with a large index (made of of four fields) which was created ad-hoc and should now be superseded by slimmer one (of the first two fields). But the problem is we can't ...
0
votes
1answer
40 views

Do you think using ObjectID as field name is a bad practice? What can go wrong if I follow this design?

I design a MongoDB collection where I am planning to use mongo ObjectID as a field name. The ObjectID is a PostID and in the array, I track all the userID who liked or disliked the post.
0
votes
0answers
45 views

How to ETL SQL Server resultset to mongo DB

Let's say I have multiple columns on sql server that I want to join and save the resultset into a single mongodb collection for faster lookup and calculations ( I'm talking about over 15 tables and ...
0
votes
0answers
15 views

Which design could be better for scale a MongoDB query for this usecase

Context Imagine that you have two MongoDB collections, one called nodes and the other called mirrors. Each mirror is replica of a node. So, in case the node is removed (for whatever reason), you ...
1
vote
3answers
44 views

Can't NoSQL DB ensure consistency if it is residing in a single server?

As NoSQL DBs always prefer BASE over ACID. Everyone always says that you can't have ACID when you are working with a NoSQL DBs. For example, we have MongoDB (a popular NoSQL DB), which is hosted ...

1
2 3 4 5
45