Tag Info

Hot answers tagged

3

You can find these programs using the Linux find command as such: find / -name 'program_name' -print 2> /dev/null Where 'program_name' is for example, bsondump. find / -name 'bsondump' -print 2> /dev/null The 2> /dev/null prevents find from printing all the paths it looks at.


1

If you want to migrate with minimal downtime, a straightforward approach would be to use MongoDB replication: Convert your current standalone node to a replica set by restarting your current mongod with a --replSet name and then running rs.initiate(). NOTE: The rs.initiate() step is a once off command that only needs to be run on a primary when the replica ...


1

To ensure there are no migrations in progress while taking your backup, you should stop the balancer via sh.stopBalancer(). Any in-progress migrations will be completed before the balancer is disabled. If you want to ensure the balancer is stopped before taking your backup, you can run the following in the mongo shell, which should return true: ...


1

To remove all fields (aside from _id), you can just update with an empty document: <?php $collection->update(array('name' => 'Amy'), array()); ?> That will update the document leaving only the _id field. Note that this won't free up any of the preallocated space for your capped collection.


1

Lot to go through here, so I'll take it piece by piece, first off splitting: I thought this meant that when a chunk hits 64mb, it splits into two equal chunks both of size 32mb. That's what is demonstrated here. Is that not correct? That's not quite how it works. If you have a 64MB chunk and you manually run a splitFind command, you will get (by ...


1

You really only have 2 choices when a primary is still processing deletes from previous migrations (which is why you are getting the failure to engage error): Wait for the deletes to finish Step down the primary of that shard (assuming it is a replica set) The first action may take a long time if the shard in question is under heavy load, but it is the ...


1

MongoDB's dynamic schema supports different fields for documents within the same collection, so there is no strict requirement for all documents to have an active field. The main consideration here will be how that affects your application logic; it may be simpler to have an explicit field present and check the value. If you have an index on a field, ...


1

I had found this a while ago for the possibility of validating json data against a schema. If you wanted to do something like this, however, there's stuff you can do in javascript inside the database.


1

The oplog is idempotent, you can run through the operations in it as many times as you want and you won't get duplicates or issues unless you run the operations on a set of data files in an odd state. However, it should be noted that as long as you have the journal as part of the LVM snapshot, re-running the oplog is not necessary for a consistent backup. ...


1

MongoDB is schemaless so it makes no sense to talk about a collection having fields and data types. You have to handle it in your own code if you want documents in a collection to have specific fields - MongoDB can't help you there.



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