24 votes
Accepted

what is "planSummary: IDHACK"?

It is just informing that mongod has chosen to use the _id index. More specifically: IDHACK means that normal query plan path (evaluation, caching, re-evaluation) was bypassed for the query shape {...
  • 5,323
7 votes
Accepted

Mongodb: Document size of 29344731 is larger than maximum of 16777216

As per MongoDB BOL here The maximum BSON document size is 16 megabytes. The maximum document size helps ensure that a single document cannot use excessive amount of RAM or, during transmission, ...
7 votes
Accepted

MongoDB explain winning plan shows "EOF"

Ok, I found out why. Apparently I was querying against the admin database. Always run use <db> guys
6 votes
Accepted

what's extsort.* (8 - 11 MB) in MongoDB dbpath? Directory _tmp

These files are used when the sort you are attempting in an aggregation exceeds the maximum allowed memory and you have allowDiskUse : true specified. The relevant pieces of the code are here (where ...
  • 9,155
4 votes
Accepted

I wish to restore a gzipped tarball - what does mongodump --archive do? Howto do a mongorestore with --gzip?

I think the problem you have is that the archive format created with --archive is not a tarball (and the docs don't say it is anywhere that I could find). Rather it is a custom packaging format which ...
  • 9,155
4 votes
Accepted

Why does Mongo query hang for a long time when creating index?

As at MongoDB 3.2, this is expected behaviour for foreground index builds: By default, creating an index blocks all other operations on a database. When building an index on a collection, the ...
  • 9,865
4 votes
Accepted

MongoDB replication: going into maintenance mode with 10333 other maintenance mode tasks in progress

What are maintenance mode tasks? The "maintenance mode tasks" message is referring to a counter of successive calls to the replSetMaintenance command and (as at MongoDB 3.4) isn't associated with ...
  • 9,865
4 votes
Accepted

Fastest way to move MongoDB to a new server

Final solution: We went with option #2 - turning off MongoDB and manually copying the database files over to the new server. It worked like a charm. For future database migrations and changes, I ...
  • 101
4 votes
Accepted

Mongodb exception: connect failed

sudo service mongo stop [This didn't work] As MongoDB BOL mongo is an interactive JavaScript shell interface to MongoDB, which provides a powerful interface for systems administrators as well as a ...
3 votes
Accepted

mongo shard + maxSize

Most likely you are using a different shell version than the db version. That is, the output of db.version() (the server version) and version() (the shell version) should be the same. For example: ...
  • 538
3 votes
Accepted

Does MongoDB produce a single file like sqlite does for an individual database? Can it?

As at MongoDB 3.4, all of the standard storage engines (WiredTiger, MMAPv1, ..) create multiple files in the dbPath. For example, in WiredTiger there are a number of metadata files, journal files, and ...
  • 9,865
3 votes
Accepted

what does that mean? COMMAND [PeriodicTaskRunner] task: UnusedLockCleaner took: 273ms

The nice part about MongoDB is that it is open source, so your answer is in the code, starting with comments about UnusedLockCleaner: Periodically purges unused lock buckets. The first time the ...
  • 9,155
3 votes
Accepted

MongoDB Restore / Snapshot Schedule - Point In Time vs. Oplog Timestamp

What's the differences between those restore points? I guess Snapshot is fast restore, because only copy already existing files to destination. But it takes compute and storage resources the generate ...
  • 9,865
3 votes

Replica Set not getting created

OK.. It's look like that you have managed to mix things. So, you have working mongodb at "C:\program files\mongodb\data" and now you want to convert that mongodb to three node replica set?!? First ...
  • 5,323
3 votes

MongoDB secondary node does not become primary when other nodes are stopped

This is by design. If you want to run with only one node, restart that node without replica set switch. If a majority of the replica set is inaccessible or unavailable to the current primary, ...
  • 12.3k
3 votes

I am trying to achieve a Disaster recovery for Mongo DB

I've discovered MongoShake (https://github.com/alibaba/MongoShake) which is an open source Golang application which does cluster to cluster replication and has been made by Alibaba. The documentation ...
  • 131
3 votes

How can we use transaction in mongodb standalone connection?

You can convert your standalone deployment to a single node replica set. Follow the tutorial to Convert a Standalone to a Replica Set, but do not add any additional members. This will allow you to ...
  • 9,865
2 votes
Accepted

Compound shard key with _id field

You'll need to rethink your shard key approach. As at MongoDB 3.2: All fields in a compound shard key must be present in all documents and will be immutable (i.e. the shard key for an existing ...
  • 9,865
2 votes
Accepted

Standalone Backup and Restore Tools

As at MongoDB 3.2, there is no option for the Windows MSI to only install the mongodump.exe and mongorestore.exe command line tools so a default install is the most straightforward option. Are ...
  • 9,865
2 votes
Accepted

getIndexes is not a function on mongo shell

db.stats() is a function call so db.stats is a function reference which has no function called getIndexes(). To get them db.getCollection("stats").getIndexes() https://docs.mongodb.com/manual/...
  • 577
2 votes
Accepted

Not able to access a database on shard mongodb cluster

Try db.repairDatabase() which fixes inconsistency across database. Check mongod and mongos logs for results.
2 votes

mapReduce output errors only when larger input select query

A variety of things I would try: Polygons are using floats, is it possible x/y tiles are wrong for some points due to rounding errors inherent in that datatype (though I don't see why this wouldn't ...
2 votes
Accepted

what is "killcursors: found 0 of 1" from mongodb.log with replicaset?

2016-08-05T15:29:36.935+0200 I COMMAND [conn39339] killcursors: found 0 of 1 As per the info you've found, this is a normal (and benign) message: no administrative action is required. This message ...
  • 9,865
2 votes
Accepted

Re-evaluating sync source log entries when chainingAllowed = false

It's hard to say without seeing all the logs, but I suspect you are seeing changes to your primary. The primary is listed in the log messages as primary: mongodb01 and it is (at the time syncing from ...
  • 9,155
2 votes
Accepted

mongo shard balancer not working

First, restart the mongos process on mongosHost3, then recheck the locks as you did in the question. If the same lock (make sure it is the same and not a new lock by the same process - check the ts ...
  • 9,155
2 votes
Accepted

use cases for db.collection.validate() - checks the structures within a namespace for correctness by scanning the collection’s data and indexes

There is no prescribed need to run db.collection.validate(true) on a regular basis for a healthy MongoDB deployment. Validation with the true or {full:true} parameter can be resource intensive, as ...
  • 9,865
2 votes

Why does Mongo query hang for a long time when creating index?

Background indexes have their own issues as well. If you are running a replica set I would recommend to do a "rolling" build Take a secondary out of the replica set Build the index Bring the ...
  • 156
2 votes

Will MongoDB exceed the 64000 ulimit threshold?

Without knowing more about your database and its usage, I can't say for sure, but in general, the high number of open files found in most busy MongoDB instances is caused by connections (one open file ...
  • 9,155
2 votes
Accepted

'bsondump --pretty --type=debug' use case and output explanation

The bsondump utility converts BSON data (which is binary) into human-readable formats. Common usage would be bsondump --pretty to inspect data formatted as MongoDB Extended JSON. This can be useful ...
  • 9,865
2 votes
Accepted

Why a covered count query need still to fetch and examine documents in mongodb?

Since nobody could find a valid reason for this issue, I opened yesterday a mongodb bug report: https://jira.mongodb.org/browse/SERVER-29326 Mongodb engineers confirmed that's a bug. Unfortunately it'...
  • 211

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