Tag Info

Hot answers tagged

2

A capped collection would allow you to maintain a relatively small list, though you would want to have a decent buffer, or be very confident in terms of the size of your documents. The other option would be a TTL collection, but that would be more prone to fragmentation since it will be doing a lot of deletes (this will mean having to deal with said ...


2

There is an obvious problem with your "delayed backup" model, in that your delayed secondaries will reflect the state of each replica set but not the full state of the sharded cluster at a given point in time. A simple example: there is a chunk migration from shard1 => shard2 in progress documents will exist on both shard1 and shard2 while they are being ...


2

If you have locked yourself out then you need to do the following: Stop your MongoDB instance Remove the --auth and/or --keyfile options from your MongoDB config to disable authentication Start the instance without authentication Edit the users as needed Restart the instance with authentication enabled


1

I think your first idea is better. The second way, as you state, is how you would model the data in an RDBMS. If you're going to use MongoDB for fun, you might as well explore the fact that it has a different data model, and structure your collections accordingly. While I'm sure performance is not going to be an issue for the scale of this project, ...


1

That query is simply a long running read, without any criteria (so it is running against all data). As it fetches back the data, it will be done in batches (based on your batch size) and then issue a getmore on the same cursor for the next set of results. The numYields count does not mean the query is being blocked, it means that it yielded its lock when ...


1

The quick answer is yes. Indexes in MongoDB mostly follow the same logic for usage and creation as you would do in MySQL. Nevertheless, as the two databases are different (MongoDB is document based, not relational, etc) there are some aspects you might want to consider (for instance, there are no joins - your data model/organization needs to reflect this ...


1

You could possibly do this using $and, albeit in quite a messy way: db.rules.find({ "$and": [ {"opts":{"$elemMatch":{"$all":["sid","1226"]}}}, {"opts":{"$elemMatch":{"$all":["gid","1"]}}}, {"opts":{"$elemMatch":{"$all":["rev","10"]}}}, ]}) That is untested, but may work. The real problem here is the nested arrays, and that each "option" set is ...



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