Importing into a default Meteor instance is fairly easy. Note that you can add a --jsonArray option if your json file is exported as an array from another system.
mongoimport --db meteor --port 3001 --collection foo --file foo.json
Mongo supports database-to-database copying, which is useful if you have large databases on a staging database that you want to copy into a local development instance.
// run mongod so we can create a staging database
// note that this is a separate instance from the meteor mongo and minimongo ins...
Preallocation. Mongo sets aside disk-space in empty containers, so when the time comes to write something to disk, it doesn't have to shuffle bits out of the way first. It does so by a doubling algorithm, always doubling the amount of disk space preallocated until it reaches 2GB; and then each preal...
They're not easily accessible. If you run the 'meteor bundle' command, you can generate a tar.gz file, and then run your app manually. Doing that, you should be able to access the mongo logs... probably in the .meteor/db directory.
If you really need to access mongodb log files, set up a regular mo...
Gotta rotate those log files, or they'll eventually eat up all of your disk space. Start with some research...
mongodb-log-file-growth
rotate-log-files
Log files can be viewed with the following command...
ls /var/log/mongodb/
But to set up log-file rotation, you'll need to do the following.....
db.posts.find().forEach(function(doc){
if(doc.arrayOfObjects){
// the false, true at the end refers to $upsert, and $multi, respectively
db.accounts.update({_id: doc._id}, {$unset: {'arrayOfObjects': "" }}, false, true);
}
});
db.posts.find().forEach(function(doc){
if(doc.oldfield){
// the false, true at the end refers to $upsert, and $multi, respectively
db.accounts.update({_id: doc._id}, {$unset: {'oldfield': "" }}, false, true);
}
});
var timestamp = Math.floor(new Date(1974, 6, 25).getTime() / 1000);
var hex = ('00000000' + timestamp.toString(16)).substr(-8); // zero padding
var objectId = new ObjectId(hex + new ObjectId().str.substring(8));