Questions tagged [mongodb-4.0]
The mongodb-4.0 tag has no usage guidance.
85
questions
0
votes
1
answer
27
views
How to disable mongosh logging?
I'm using mongosh v1.1.7 and I'd like to disable logging (these ones) because it's taking up all my disk space.
How can I do that?
I found a similar question but it only applies to mongo
1
vote
1
answer
67
views
Allow connection to mongo only from my server droplet
Recently I created a server with MongoDB preinstalled on a DigitalOcean droplet following these tutorials
DigitalOcean - Initial server setup
DigitalOcean - How to secure MongoDB on Ubuntu
Medium - ...
0
votes
0
answers
166
views
Application can't connect to MongoDB server through IP address
I have a java application that connects to mongoDB 4.0.2 replicaSet with one node (Primary). I upgraded the database to mongoDB 4.2.20. Even though, after making tests I decided to downgrade to 4.0.2. ...
1
vote
1
answer
15
views
Run mongoimport in a complete isolation
We planning our data migration from one standalone server to other standalone server. (we can't use replication due to some constraint)
We had used fsyncLock() and fsyncUnlock() to ensure complete ...
-1
votes
1
answer
42
views
How to store data in two separate mongo db server
I have application which uses mongo db currently I have one instances of mongo db server in my first data center in my another data center I have second mongo db instances what I want to archive is ...
1
vote
1
answer
395
views
How to update mongodb configure at Docker?
I am unable to enable security parameter at docker of mongodb at mongod.conf file. So how can I configure any parameter at mongod.conf file?
I found a file inside mongodb container named it as mongod....
0
votes
0
answers
84
views
Restore Mongo DB backup
I have mongodb backup files as in.wt and.bson and some wieldtrigger files. I have installed mongodb on a new server and copied backed up files to /var/lib/mongo folder and restarted the mongodb ...
0
votes
0
answers
23
views
How to monitor on prem mongodb cache-misses with prometheus in kubernetes
Using mongodb 4.0.x, we are running as a statefulset in an EKS cluster. We need to monitor it such that we want to know when a potential customer impacting issue may occur. We're already monitoring ...
0
votes
1
answer
658
views
Do I need to split a 1.5 billion document database into several in a standalone MongoDB?
There will be total 1.5 billion documents in nearly 100 collections in one database. Need I to separate this database into several? Is there a performance limitation for a single database when the ...
0
votes
1
answer
395
views
Update data type from integer to decimal128 for all document having nest array in mongo db
Had a JSON structure which is having nested array and need to update all data type for that json structure
[
{
student: [
{
name: {
firstName: "Rahul",
...
0
votes
1
answer
627
views
update datatype field int to decimal128 in mongo db in nested json structure
Hi have tried to updated nested field datatype
db.test.find().forEach(function(data){
data.age = NumberDecimal(data.age);
data.phone.$.mob = NumberDecimal(data.phone.$.mob);
db.test.updateOne({_id:...
0
votes
1
answer
553
views
question on mongodb oplog usage
One of my secondary on a PSS replica set (v4.0.4) always goes out of sync after it tries to rollback automatically after local.oplog.rs collection cleans up on the secondary.
Question
Though I've ...
0
votes
1
answer
178
views
In MongoDB ReplicaSet, does a priority 0 node (hidden, delayed, etc) have to have the same Oplog size as the nodes that can become primary?
I understand the Oplog collection in MongoDB replica set. A bigger Oplog means a bigger recovery window when a data bearing node goes down.
However for nodes that can never be primary, is the Oplog ...
-1
votes
1
answer
580
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 ...
1
vote
2
answers
3k
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
1
answer
7k
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 ...
1
vote
2
answers
1k
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
1
answer
1k
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
2
answers
178
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
0
answers
42
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
0
answers
155
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
1
answer
637
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
1
answer
334
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
1
answer
243
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
1
answer
165
views
Unable to start mongod daemon and it looks its crashing
DummyD3 is node3 of 3 node replication cluster.
DummyD2 is primary and
DummyD1 is Secondary (which is in sync with primary).
I tried deleting the data under data path and did rsync from other ...
0
votes
1
answer
136
views
queryHash field not available in mongos slow query logs
Mongodb V4.2 has introduced queryHash in slow query logs to identify slow queries with same query shape. While this queryHash is available in slow query logs in mongod logs (shard server), it is not ...
2
votes
0
answers
236
views
shard migration failed with aborted at system.config.sessions collection!
A month ago, I have upgraded my mongodb cluster to version 4.4.1 from 3.6.
Then recently mongodb shard migration failed with error 'aborted' as follows:
balancer:
Currently enabled: yes
...
2
votes
1
answer
2k
views
Read Concern Majority when majority nodes are down
I have a 6 node replica set (all of them data bearing) with 5 voting members. If I lose 3 voting members, I will not have a majority voting members and my replica set will become read-only.
In this ...
0
votes
1
answer
50
views
How many cluster must i created on MongoDB Atlas?
I want to implement MongoDB transactional. But there is a term that must not single alone server. So, how many clusters must I create to an implement that?
1
vote
1
answer
69
views
MongoDB: Queries running twice slow on NEW server compared to OLD server
I transferred current/old running DB into a new standalone server for MongoDB. To do this, I performed the following:
Took dump of data from OLD server
Restored data from the generated dump into NEW ...
1
vote
0
answers
681
views
Upsert unique index Mongodb?
I've written ETL in MongoDB which processes data from multiple collections and insert the processed data in new collection. While inserting processed data to new collection, I get Duplicate key Error ...
3
votes
2
answers
677
views
mongodb removeShard issue with config.system.session
I have a staging mongodb 4.0.19 sharded cluster with 2 replica set shards . I want to remove one shard. I followed the documentation: https://docs.mongodb.com/v4.0/tutorial/remove-shards-from-cluster/...
1
vote
2
answers
5k
views
Mongoose is not showing the ISODate in the result
I am using mongodb version 4.2.2.
I have following data:
{
"_id" : ObjectId("5f0c58089c058304f7a64fa9"),
"date" : ISODate("2021-07-11T00:00:00.000Z"),
...
0
votes
1
answer
1k
views
MongoDB dump oplog based on timestamp
I'm trying to dump oplog.rs from local database, based on timestamp.
Query directly from mongo shell works but not from mongodump
Query from mongo shell
RS1:PRIMARY> db.oplog.rs.find({"ts" : {$gt ...
0
votes
1
answer
74
views
Error configuring mongodb replicaset with inmemory
I'm trying to configure a MongoDB replicaset with 3 replicas. The primary and another use the in memory storage engine, and the third uses wired tiger. I am using this configuration.
When I restart ...
0
votes
0
answers
183
views
MongoDB works only on user is assigned to admin database
I am using mongo db with authentication and it is working as expected when I map the user to the admin database like below,
use admin;
db.getUsers();
{
"_id" : "admin.test1",
...
0
votes
1
answer
39
views
MongoDB Reconnects to Secondaries Too Fast
How can MongoDB 4.0.12 be configured to SLOW its rate of re-connecting to its replica members when they are down?
I had MongoDB replica members die. The online replica members get “connection refused”...
0
votes
2
answers
3k
views
mongodb conf node won't start - compatibility error
I recently upgraded a dev sharded-cluster from 3.6 to 4.0 - one of the conf servers is now failing to start:
2020-01-30T13:19:02.972-0600 F CONTROL [initandlisten] ** IMPORTANT:
UPGRADE PROBLEM:...
0
votes
1
answer
1k
views
How to use mongoexport command with ssl?
I am trying to export collection data from (SSL MongoDB 4.x), for this I am running below command on linux terminal.
Earlier I used mongoexport command in Linux terminal without SSL which works ...
1
vote
1
answer
28
views
How to get only those docs which has all the match fields in mongoose
Let say I have the following collection named survey:
{ _id: 1, results: [ { product: "abc", active: true}, { product: "xyz", active: true} ] }
{ _id: 2, results: [ { product: "abc", active: false }, ...
2
votes
1
answer
796
views
Why does MongoDB 4.0 require journaling for replica set members using WiredTiger?
This is a very interesting change in version 4.0 since checkpoints seem to serve a very similar role to journaling.
The checkpoint ensures that the data files are consistent up to and including the ...
0
votes
1
answer
295
views
Ranged Sharding - Logic behind forming ranges for hexadecimal string
I have a sharded collection where the shard key is a field called "uuid". This field's value is of type string and represents hexadecimal values i.e a hexadecimal string. For each document this "uuid" ...
2
votes
0
answers
863
views
MongoDB Chunk Migration fails with "error 'aborted'"
I have a simple setup:
2 Mongos
3 Shards, deployed as a Replica Set
3 Config Servers, deployed as a Replica Set
Each replica set consists of 1 Primary, 1 Secondary and 1 Arbiter. (Except the Config ...
0
votes
1
answer
3k
views
Filter based on values after join operation - MongoDB
I have two collections in the following format -
collection1:
{
"_id": "col1id1",
"name": "col1doc1",
"properties": [ "<_id1>", "<_id2>", "<_id3>"]
}
collection2:
{
...
-1
votes
1
answer
34
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) ...
1
vote
0
answers
73
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
1
answer
292
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 ...
0
votes
1
answer
355
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 ...
0
votes
1
answer
410
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 --...
1
vote
0
answers
214
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",
"...