diff --git a/Orleans.Providers.MongoDB/Membership/Store/Single/SingleMembershipCollection.cs b/Orleans.Providers.MongoDB/Membership/Store/Single/SingleMembershipCollection.cs index 986d96f..e3f7240 100644 --- a/Orleans.Providers.MongoDB/Membership/Store/Single/SingleMembershipCollection.cs +++ b/Orleans.Providers.MongoDB/Membership/Store/Single/SingleMembershipCollection.cs @@ -92,8 +92,11 @@ public async Task ReadRow(string deploymentId, SiloAddress public async Task UpdateIAmAlive(string deploymentId, SiloAddress address, DateTime iAmAliveTime) { - await Collection.UpdateOneAsync(x => x.DeploymentId == deploymentId, - Update + var filter = Builders.Filter.And( + Builders.Filter.Eq(x => x.DeploymentId, deploymentId), + Builders.Filter.Exists($"Members.{BuildKey(address)}", true)); + + await Collection.UpdateOneAsync(filter, Update .Set($"Members.{BuildKey(address)}.IAmAliveTime", LogFormatter.PrintDate(iAmAliveTime))); } diff --git a/Orleans.Providers.MongoDB/Orleans.Providers.MongoDB.csproj b/Orleans.Providers.MongoDB/Orleans.Providers.MongoDB.csproj index 04492a3..1815fd9 100644 --- a/Orleans.Providers.MongoDB/Orleans.Providers.MongoDB.csproj +++ b/Orleans.Providers.MongoDB/Orleans.Providers.MongoDB.csproj @@ -15,7 +15,7 @@ Orleans OrleansProviders MongoDB snupkg net8.0 - 8.0.2 + 8.0.3