No need to print the entire history each time

This commit is contained in:
James Allen 2013-08-09 13:54:30 +01:00
parent 7a3b78da43
commit bef05c31f4

View file

@ -12,19 +12,7 @@ db.docOps.find { }, { doc_id: true }, (error, docs) ->
ConversionManager.convertOldRawUpdates doc_id, (error) ->
return callback(error) if error?
console.log doc_id, "DONE"
db.docHistory.find { doc_id: ObjectId(doc_id) }, (error, docs) ->
return callback(error) if error?
doc = docs[0]
if doc?
for update in doc.docOps
op = update?.op[0]
if op?.i?
console.log doc_id, update.meta.start_ts, update.meta.end_ts, update.meta.user_id, "INSERT", op.p, op.i
else if op?.d?
console.log doc_id, update.meta.start_ts, update.meta.end_ts, update.meta.user_id, "DELETE", op.p, op.d
else
console.log doc_id, "NO HISTORY"
callback()
callback()
async.series jobs, (error) ->
throw error if error?
process.exit()