1.1 KiB
1.1 KiB
Diablo 3 Dingsi
Track Diablo 3 profile progression per season.
Additional notes on database management
When adding indexes all collections are required to have the dropDups index on
the 'lastUpdated' field. WARNING: only works on version <=2.6 of MongoDB
CODE:
// Reindex database
db.getCollectionNames().forEach(function(collectionName) {
var collection = db.getCollection(collectionName);
if (collectionName.indexOf('hero') > 0) {
collection.ensureIndex({'last-updated': 1}, {unique: true, dropDups: true});
} else {
collection.ensureIndex({lastUpdated: 1}, {unique: true, dropDups: true});
}
});
// drop wrong indexes from hero collection
db.getCollectionNames().forEach(function(collectionName) {
if (collectionName.indexOf('hero') > 0) {
var collection = db.getCollection(collectionName);
collection.dropIndex('lastUpdated_1');
}
});
Forwarding database connections through SSH to remote MongoDB server
$ ssh -L 27017:localhost:27017 -Nv sif.goatpr0n.de
Milestones
- Release 1.0
- Display hero details