You might already know the answer just posting the answer here for someone else like me ending in this post :D
vi /etc/mongo.conf
smallfiles = true
This would set smallfiles true once you restart your mongodb.
UPDATE:
Rounding a little bit more the answer smallfiles
option in mongo what does is reducing the initial and journal data files size, this is useful if your machine do not have to much space or if you are gonna have multiple databases with small data each.
I my personal opinion smallfiles
do not increase performance but like mentioned before could help for this specific scenarios another example is with Docker if you are not using -v "path/to/local/drive:"/data/db"
then is better to set smallfiles
true in my case if i don't the container breaks because it can't allocate the default data file space.
To add smallfiles
to the mongo.conf you can do:
echo "smallfiles = true" >> /etc/mongo.conf
service mongod restart
More detailed info here: http://docs.mongodb.org/manual/reference/configuration-options/#storage.mmapv1.smallFiles
Hope this helps :D
Important UPDATE:
Starting in version 4.2, MongoDB removed smallfiles
option.
More details at: https://docs.mongodb.com/manual/reference/program/mongos/#bin.mongos
So for latest available options, check the updated manual at: https://docs.mongodb.com/manual/tutorial/rotate-log-files/
You can start a single node replica set by starting the mongod
with the replSet argument/config option, that is all that is required. It takes a name argument, which will then function as the name of the replica set in question. Once you have done that, you simply run rs.initiate() from the shell when connected to the node (this is only needed once).
This is described in detail here:
http://docs.mongodb.org/manual/tutorial/convert-standalone-to-replica-set/
To stay with just a single node, simply do not follow the "Expanding the set" instructions.
Best Answer
The
$indexstats
command was added for the MongoDB 3.2 server release in Dec 2015. Without server support for measuring or logging index use, I'm not aware of any obvious workaround short of modifying the 2.0.x server code and building a custom server.MongoDB 2.0 is a relatively ancient server version: it was first released in Sept 2011 and reached End-of-Life in March 2013. I'd strongly recommend planning to upgrade to a modern & supported version of MongoDB (currently 3.4+, although 3.4 will reach EOL in Jan 2020). There are numerous essential bug fixes, stability, and security improvements since 2.0.