run only user/identity migration

This commit is contained in:
Berkeley Martinez
2015-08-16 03:45:00 -07:00
parent 129eebcc41
commit 0908844e6d

View File

@ -6,7 +6,7 @@ var Rx = require('rx'),
mongodb = require('mongodb'), mongodb = require('mongodb'),
secrets = require('../config/secrets'); secrets = require('../config/secrets');
const batchSize = 100; const batchSize = 20;
var MongoClient = mongodb.MongoClient; var MongoClient = mongodb.MongoClient;
Rx.config.longStackSupport = true; Rx.config.longStackSupport = true;
@ -185,6 +185,7 @@ var userIdentityCount = users
// count how many times insert completes // count how many times insert completes
.count(); .count();
/*
var storyCount = dbObservable var storyCount = dbObservable
.flatMap(function(db) { .flatMap(function(db) {
return createQuery(db, 'stories', {}, batchSize); return createQuery(db, 'stories', {}, batchSize);
@ -200,16 +201,17 @@ var storyCount = dbObservable
return insertMany(dats.db, 'story', dats.stories, { w: 1 }); return insertMany(dats.db, 'story', dats.stories, { w: 1 });
}) })
.count(); .count();
*/
Rx.Observable.combineLatest( Rx.Observable.combineLatest(
userIdentityCount, userIdentityCount,
userSavesCount, userSavesCount,
storyCount, // storyCount,
function(userIdentCount, userCount, storyCount) { function(userIdentCount, userCount) {
return { return {
userIdentCount: userIdentCount * batchSize, userIdentCount: userIdentCount * batchSize,
userCount: userCount * batchSize, userCount: userCount * batchSize
storyCount: storyCount * batchSize // storyCount: storyCount * batchSize
}; };
}) })
.subscribe( .subscribe(