fix migrations

This commit is contained in:
Matteo Pagliazzi
2015-09-09 22:32:12 +02:00
parent 3931894d97
commit 0330735e8e
3 changed files with 126 additions and 65 deletions

View File

@@ -4,21 +4,17 @@
var mongo = require('mongoskin');
var dbserver = 'mongodb://url';
var dbname = 'db';
var dbserver = 'url';
var dbname = 'name';
var db = mongo.db(dbserver + '/' + dbname + '?auto_reconnect');
var dbGroups = db.collection('groups');
console.log('Begins work on db');
dbGroups.remove({
members: {$size: 0},
$or: [
{type: 'party'},
{privacy: 'private'}
]
}, function(err, res){
dbGroups.findEach({
memberCount: 0,
}, {_id: 1}, function(err, res){
if(err) throw err;
console.log(res);