@@ -14,7 +14,7 @@ import org.mongodb.scala.model.Updates._
1414
1515object SyncStrategy extends Enumeration {
1616 type SyncStrategy = Value
17- val Replcace = Value
17+ val SyncAll = Value
1818}
1919
2020object SyncDirection extends Enumeration {
@@ -27,7 +27,7 @@ case class MongoSyncException(message: String) extends Exception(message)
2727case class MongoSyncOperation (
2828 collectionName : String ,
2929 syncDirection : SyncDirection = SyncDirection .SourceToTarget ,
30- syncStrategy : SyncStrategy = SyncStrategy .Replcace ,
30+ syncStrategy : SyncStrategy = SyncStrategy .SyncAll ,
3131 idColumnName : String = DatabaseProvider .ObjectIdKey
3232) extends LazyLogging
3333 with Filter {
@@ -69,12 +69,12 @@ case class MongoSyncOperation(
6969 left : DatabaseProvider ,
7070 right : DatabaseProvider ,
7171 countBefore : Int ,
72- diff : Seq [Document ]
72+ documentsToSync : Seq [Document ]
7373 ): MongoSyncResult = {
7474 val start = System .currentTimeMillis()
7575 val syncDate = new Date ()
76- if (diff .nonEmpty) {
77- val idSet : Set [ObjectId ] = diff .map(doc => doc.getObjectId(idColumnName)).toSet
76+ if (documentsToSync .nonEmpty) {
77+ val idSet : Set [ObjectId ] = documentsToSync .map(doc => doc.getObjectId(idColumnName)).toSet
7878 val documentsToSync : Seq [Document ] = left.dao(collectionName).find(valueFilter(idColumnName, idSet)).results()
7979 right.dao(collectionName).bulkWriteMany(documentsToSync).result()
8080 val update = combine(
@@ -89,7 +89,7 @@ case class MongoSyncOperation(
8989 collectionName,
9090 syncDate,
9191 true ,
92- diff .size,
92+ documentsToSync .size,
9393 countBefore,
9494 countAfter,
9595 (System .currentTimeMillis() - start)
0 commit comments