Permalink
Browse files

changed counters findandmodify to upsert

  • Loading branch information...
1 parent b36253e commit 06a16394af3f0426c41b419c59eeeaaefe3d23a6 @tyronegroves tyronegroves committed Sep 21, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/NEventStore.Persistence.MongoDB/MongoPersistenceEngine.cs
@@ -49,9 +49,9 @@ public MongoPersistenceEngine(MongoDatabase store, IDocumentSerializer serialize
_getNextCheckpointNumber = () => TryMongo(() =>
{
- IMongoQuery query = Query.And(Query.EQ("_id", "CheckpointNumber"));
+ IMongoQuery query = Query.EQ("_id", "CheckpointNumber");
IMongoUpdate update = Update.Inc("seq", 1);
- FindAndModifyResult result = Counters.FindAndModify(query, null, update, true);
+ FindAndModifyResult result = Counters.FindAndModify(query, null, update, true, true);
return result.ModifiedDocument["seq"].ToInt32();
});
}

0 comments on commit 06a1639

Please sign in to comment.