fix problems with migrations and start firebase migration

This commit is contained in:
Matteo Pagliazzi
2015-09-06 19:23:11 +02:00
parent 45f2b093f8
commit 4bb2c33e40
2 changed files with 7 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ dbGroups.findEach({}, {_id: 1, members: 1}, {batchSize: 500}, function(err, grou
countUsers++; countUsers++;
console.log('User: ', countUsers); console.log('User: ', countUsers);
// TODO updating the same group many times concurrently can cause problems?
dbGroups.update({ dbGroups.update({
_id: group._id _id: group._id
}, { }, {

View File

@@ -1,5 +1,5 @@
/* /*
* Remove emoty groups * Remove empty private groups
*/ */
var mongo = require('mongoskin'); var mongo = require('mongoskin');
@@ -13,7 +13,11 @@ var dbGroups = db.collection('groups');
console.log('Begins work on db'); console.log('Begins work on db');
dbGroups.remove({ dbGroups.remove({
members: {$size: 0} members: {$size: 0},
$or: [
{type: 'party'},
{privacy: 'private'}
]
}, function(err, res){ }, function(err, res){
if(err) throw err; if(err) throw err;