Просмотр исходного кода

include the current date in the updates to docHistoryStats

Brian Gough 11 лет назад
Родитель
Сommit
66bca8d05c
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      services/track-changes/app/coffee/MongoManager.coffee

+ 4 - 1
services/track-changes/app/coffee/MongoManager.coffee

@@ -37,7 +37,10 @@ module.exports = MongoManager =
 		async.series jobs, (err, results) ->
 			if not temporary
 				# keep track of updates to be packed
-				db.docHistoryStats.update {doc_id:ObjectId(doc_id)}, {$inc:{updates:updates.length}}, {upsert:true}, () ->
+				db.docHistoryStats.update {doc_id:ObjectId(doc_id)}, {
+					$inc:{update_count:updates.length},
+					$currentDate:{last_update:true}
+				}, {upsert:true}, () ->
 					callback(err,results)
 			else
 				callback(err,results)