The Stack Overflow podcast is back! Listen to an interview with our new CEO.
4

You might want to consider opening an issue on MongoDB's Issue Tracker and providing the *.mdmp file in the issue. *.mdmp files are considered to be Microsoft Dump Files. Compressed file created by Windows after a program error or crash; contains data "dumped" from the program's memory space; saves information about the error, which can be used for ...


4

I have successfully upgraded a database from 2.4 to 4.0 using the following 3 step method: use 2.4 mongobackup on the 2.4 database delete all .json files from the outputted dump directory use 4.0 mongorestore on the remaining .bson files


3

First you download the Current Stable Release (3.6.0) from Windows Server 2008 R2 64-bit and later, with SSL support x64 with (msi) file Once you shall open the https://www.mongodb.com/download-center#community , directly it will open to first tab . which is in MongoDB download center, But you have to click on the Community Server and download (.msi) files....


3

I look like that you haven't enabled authentication (--auth) at the database. Without authentication, there is no authorization. That's why all users can do now whatever they want.


2

As you said you are trying to import a MongoDB database, And you are using the MongoDB command such as mongorestore. And also as you said you have taken mongodump backup of MongoDB database , which MongoDB version is 2.4 & you are going to import that mongodump backup in MongoDB , which version is 3.6. As I would like to say here as per MongoDB BOL ...


2

Problem here is your replSetName: parameters. BOTH config servers must be at same replica set, f.ex. conf and then those shards (data nodes) both should have different replica set names. f.ex. rs0 and rs1. Now your config1 is rs0 and config2 is rs1.


2

You've configured this node as a replica set member: replication: replSetName: "rs0" On startup a new MongoDB server does not have a replica set configuration yet. The server will be in an unknown replica set member state until you either add this member to an existing replica set configuration or use rs.initiate() to establish it as the first member ...


2

Since you are using a hosted database service (MongoDB Atlas), many administrative commands are limited as they are either provided via the management interface or likely to introduce performance/stability issues. The Atlas free tier has additional limitations since it is backed by a shared MongoDB instance. See: Unsupported Commands in M0/M2/M5 Clusters. ...


2

This is a known issue recently discovered in the MongoDB 3.6.3 release when using WiredTiger on Windows: SERVER-33982: Unbounded growth of pre-allocated log files. This issue will be corrected in the 3.6.4 production release, so upgrading to MongoDB 3.6.4 (or newer) when available should resolve the issue. In the interim, possible workarounds are: Disable ...


1

I found a free tool that will set SetSystemFileCacheSize here with 16 gigs of RAM I set it to 1024 4096 and the mongod warning went away


1

I have two machines (it is a restriction) configured as a replica set with MongoDB 3.6.5. Is it possible to run an arbiter on a machine that also hosts a secondary member? As I am not discarding anything of @Stennie but I would like to say that as per MongoDB documentation here The minimum architecture of a replica set has three members. A three member ...


1

Is it possible to run an arbiter on system that also hosts a secondary member? There is no technical restriction on running multiple processes on the same host, as long as they are listening to different port numbers. For example, you could start an arbiter listening to port 27018 (instead of the default 27017). However, you do need to consider the ...


1

I have two databases (Mongodb 3.6.5) using ReplicaSet, when I made a split in the network, I am forcing the secondary database to be the primary. Forced reconfiguration should only be used as an administrative last resort. This is a risky approach with only two replica set members as you can easily create data challenges that will require significant manual ...


1

We know that the Replica Set does not work by itself with two machines, but we have this limitation. If your goal is high availability with automated failover I would definitely aim for a solution that does not involve reconfiguring the replica set or allow for the possibility of multiple active primaries. Ideally this does require a third machine so you ...


1

So I found solution, --drop shoud be added in the command: mongodump -h $HOST:$PORT --ssl --sslAllowInvalidCertificates --authenticationDatabase $authdb -u $user -p $pass --drop --gzip --archive=$destination


1

The solution is to use NumberInt instead of parseInt. var coll = db.getCollection('info'); var bulk = coll.initializeOrderedBulkOp(); var counter = 0; coll.find({ width_px: { $type: "string" }}).forEach(function(data) { var updoc = { "$set": {} }; updoc["$set"]["width_px"] = NumberInt(data.width_px); // queue the update bulk.find(...


1

As per MongoDB documentation here From the Documents tab in MongoDB Compass, you can view, insert, clone, modify, and delete documents . First you have to connect your mongod with MongoDB Compass then you shall able to change your desire data type of their respective field in MongoDB. Change Field Type You can change the data type of a field by using the ...


1

If you're using the WiredTiger storage engine, data in the database is compressed (using snappy by default). In contrast, mongodump output is not compressed. This is why 2TB may not be enough to backup a 1.5TB database. To determine the uncompressed size of your database, you can run db.stats().dataSize in the mongo shell (see manual). To determine the ...


1

As per MongoDB blog documentation from Asya Kamsky here CPU load is almost never the bottleneck/limiting resource for MongoDB (or databases in general). Unless you are running a large number of MapReduce jobs and/or aggregation framework queries, high CPU utilization tends to indicate that you have poorly tuned queries possibly with in-memory sorts (as ...


1

You can try a configuration like the one below; server: ssl: key-store: classpath:keystore.jks key-store-password: secret key-password: another-secret data: mongodb: authentication-database: admin database: <database> host: <host> password: <password> port: <port&...


1

I created role with your db.createRole(..., I didn't "need" to use your grantPrivilegesToRole command. Then I created user db.createUser({"user":"test2",pwd:"password",roles:["master"]}) and changes to it with db.auth("test2","password") If I change to database test, command db.lock.insert({}) fails, as it should be, but if I change database to ...


1

You can use the $jsonSchema query operator to find relevant documents. For example, using the mongo shell: // Retrieve the current validator for the "students" collection var schema = db.getCollectionInfos({name:"students"})[0].options.validator // Find any documents not matching the schema db.students.find({$nor: [ schema ]}) Similarly, you can use the $...


1

As I am able to see you are getting the insert writeError with Error code : 121 like that "nInserted" : 0, "writeError" : { "code" : 121, "errmsg" : "Document failed validation" As per MongoDB blog documentation of @Jai Hirsch here for MongoDB document validation. Sometimes you want completely free form documents and sometimes you don’...


1

You just kill the process. killall mongod To check that you don't have any mongod process running anymore, you can use ps -ef|grep mongod|grep -v grep or just pgrep mongod. With that latter, if you get pid number (as answer), mongod is still running


1

Yes, it is normal behavior. Those connections are from other mongod nodes, because every node "watches" every other node to see who is reachable. This because election must be started even in the situation where secondary node disappear from replica set.


1

The purpose of a hidden node is to provide specific read-only workloads, or have copies over your data. which are hidden from the application.Hidden nodes can also be set with a delay in their replication process. We call these delayed nodes. The purpose of having delayed nodes is to allow resilience to application level corruption,without relying on cold ...


1

The solution is the openUploadStreamWithId method.It has this signature: openUploadStreamWithId(id: GridFSBucketWriteStreamId, filename: string, options?: GridFSBucketOpenUploadStreamOptions): GridFSBucketWriteStream; The GridFSBucketWriteStreamId type is like this: type GridFSBucketWriteStreamId = string | number | Object | ObjectID; So you can call it ...


1

I wanted to know, how can I add a reference to another collection? Relationships in MongoDB represent how various documents are logically related to each other. Relationships can be modeled via Embedded and Referenced approaches. Such relationships can be either 1:1, 1:N, N:1 or N:N. It's possible through Modeling Referenced Relationships and DBRefs. Here ...


1

So, after loop finishes, the results of db.collection.getShardDistribution() shows that all chunks are located on only one of shards, after few minutes in fact chunks are distributed evenly between shards. Here is my question: should not mongos distribute chunks between shards during execution of loop, instead of directing them all to one shard? The issue ...


1

You need to add Type=forking under [Service] header. It's service watchdog what kills mongod. Check this.


Only top voted, non community-wiki answers of a minimum length are eligible