Permalink
Browse files

Add "nupdated" field to SystemProfileInfo class.

The field "nupdated" that shows the number of documents updated by an update operation was missing from the SystemProfileInfo class. It is now added as a .NumberUpdated property.
  • Loading branch information...
1 parent 585abea commit 9d8eb8bb95d9c0fa1e74c39534da2aa865e63d77 Einar Egilsson committed with craiggwilson Dec 10, 2012
Showing with 12 additions and 0 deletions.
  1. +10 −0 MongoDB.Driver/SystemProfileInfo.cs
  2. +2 −0 MongoDB.DriverUnitTests/SystemProfileIntoTests.cs
View
10 MongoDB.Driver/SystemProfileInfo.cs
@@ -242,6 +242,15 @@ public int NumberToSkip
}
/// <summary>
+ /// Gets or sets the number of documents update by an update operation.
+ /// </summary>
+ public int NumberUpdated
+ {
+ get { return GetValue<int>("NumberUpdated", 0); }
+ set { SetValue("NumberUpdated", value); }
+ }
+
+ /// <summary>
/// Gets or sets the number of yields.
/// </summary>
public int NumberOfYields
@@ -468,6 +477,7 @@ public SystemProfileInfoSerializer()
RegisterMember("NumberScanned", "nscanned", Int32Serializer.Instance, typeof(int), null);
RegisterMember("NumberToReturn", "ntoreturn", Int32Serializer.Instance, typeof(int), null);
RegisterMember("NumberToSkip", "ntoskip", Int32Serializer.Instance, typeof(int), null);
+ RegisterMember("NumberUpdated", "nupdated", Int32Serializer.Instance, typeof(int), null);
RegisterMember("NumberOfYields", "numYield", Int32Serializer.Instance, typeof(int), null);
RegisterMember("Op", "op", StringSerializer.Instance, typeof(string), null);
RegisterMember("Query", "query", BsonDocumentSerializer.Instance, typeof(BsonDocument), null);
View
2 MongoDB.DriverUnitTests/SystemProfileIntoTests.cs
@@ -79,6 +79,7 @@ public void TestAll()
NumberScanned = 6,
NumberToReturn = 7,
NumberToSkip = 8,
+ NumberUpdated = 9,
NumberOfYields = 10,
Op = "op",
Query = new BsonDocument("query", 1),
@@ -112,6 +113,7 @@ public void TestAll()
Assert.AreEqual(info.NumberScanned, rehydrated.NumberScanned);
Assert.AreEqual(info.NumberToReturn, rehydrated.NumberToReturn);
Assert.AreEqual(info.NumberToSkip, rehydrated.NumberToSkip);
+ Assert.AreEqual(info.NumberUpdated, rehydrated.NumberUpdated);
Assert.AreEqual(info.NumberOfYields, rehydrated.NumberOfYields);
Assert.AreEqual(info.Op, rehydrated.Op);
Assert.AreEqual(info.Query, rehydrated.Query);

0 comments on commit 9d8eb8b

Please sign in to comment.