Skip to content

Commit

Permalink
update driver to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
dj-nitehawk committed Jan 30, 2023
1 parent d3b74a7 commit 669489f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.4" />
<PackageReference Include="MongoDB.Driver.GridFS" Version="2.18.0" />
<PackageReference Include="MongoDB.Driver.GridFS" Version="2.19.0" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion MongoDB.Entities/Core/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ private static ProjectionDefinition<ChangeStreamDocument<T>, ChangeStreamDocumen
{
if (element.Name != "_id")
{
doc["fullDocument." + element.Name] = element.Value;
var val = element.Value.ToString();
doc["fullDocument." + element.Name] = val.Insert(1, "fullDocument.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions MongoDB.Entities/MongoDB.Entities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>

<Version>21.0.1</Version>
<Version>21.0.2</Version>

<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>MongoDB.Entities</RootNamespace>
Expand Down Expand Up @@ -33,7 +33,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="MongoDB.Driver" Version="2.18.0" />
<PackageReference Include="MongoDB.Driver" Version="2.19.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions Tests/Models/Flower.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class Flower : BaseEntity, ISoftDeleted
public string Color { get; set; }
public Many<CustomerWithCustomID> Customers { get; set; }
public bool IsDeleted { get; set; }
public Flower NestedFlower { get; set; }

public Flower()
{
Expand Down
9 changes: 6 additions & 3 deletions Tests/TestWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task watching_with_projection_works()

watcher.Start(
EventType.Created | EventType.Updated,
f => new Flower { Color = f.Color },
f => new Flower { Color = f.Color, NestedFlower = f.NestedFlower },
f => f.FullDocument.Color == "red");

await Task.Delay(500);
Expand All @@ -61,7 +61,7 @@ public async Task watching_with_projection_works()
};

await new[] {
new Flower { Name = "test", Color = "red" },
new Flower { Name = "test", Color = "red", NestedFlower = new() {Name = "nested" } },
new Flower { Name = "test", Color = "red" },
new Flower { Name = "test", Color = "red" }
}.SaveAsync();
Expand All @@ -74,7 +74,10 @@ await new[] {
await Task.Delay(500);

Assert.AreEqual(3, allFlowers.Count);
Assert.IsTrue(allFlowers[0].Name == null && allFlowers[0].Color == "red");
Assert.IsTrue(
allFlowers[0].Name == null &&
allFlowers[0].Color == "red" &&
allFlowers[0].NestedFlower.Name == "nested");
}

[TestMethod]
Expand Down
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
### CHANGELOG
- upgrade packages
- upgrade mongodb driver to v2.19
- update watcher to be compatible with v3 linq engine

0 comments on commit 669489f

Please sign in to comment.