I'm scraping tweets and inserting them into a mongo database for analysis work in python. I want to check the size of my database so that I won't incur additional charges if I run this on amazon. How can I tell how big my current mongo database is on osx? And will a free tier cover me?
For posterity:
Run the mongo shell: mongo
In the shell run: db.adminCommand("getCmdLineOpts")
This will give the location of the relative files, including the db path. Here are the results from two machines I have running mongo.
"parsed": {
"config": "/usr/local/etc/mongod.conf",
"dbpath": "/usr/local/var/mongodb",
"logappend": "true",
"logpath": "/usr/local/var/log/mongodb/mongo.log"
},
"parsed" : {
"config" : "/etc/mongodb.conf",
"dbpath" : "/var/lib/mongodb",
"logappend" : "true",
"logpath" : "/var/log/mongodb/mongodb.log",
},
I believe on OSX the default location would be /data/db
. But you can check your config file for the dbpath
value to verify.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With