Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #256 from tyronegroves/counters_upsert

Changed Counters FindAndModify to upsert so that the collection is created on the first checkpoint
  • Loading branch information...
commit fde08c6864d2dc6c194d3842af218617170e8ff0 2 parents b36253e + 06a1639
@damianh damianh authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/NEventStore.Persistence.MongoDB/MongoPersistenceEngine.cs
View
4 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();
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.