Skip to content

Commit

Permalink
merge driver 2.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm360 committed Jun 28, 2024
2 parents 59de851 + 0aeadcf commit b4a67f5
Show file tree
Hide file tree
Showing 172 changed files with 2,049 additions and 789 deletions.
17 changes: 17 additions & 0 deletions Release Notes/Release Notes v2.27.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# .NET Driver Version 2.27.0 Release Notes

This is the general availability release for the 2.27.0 version of the driver.

The main new features in 2.27.0 include:

+ Support $sample aggregation operator - [CSHARP-2659](https://jira.mongodb.org/browse/CSHARP-2659)
+ Implement Equals method for serializers in LINQ3 - [CSHARP-3315](https://jira.mongodb.org/browse/CSHARP-3315)
+ Avoid Appending Write/Read Concern in Atlas Search Index Helper Commands - [CSHARP-4839](https://jira.mongodb.org/browse/CSHARP-4839)
+ Disallow comma character in authMechanismProperties connection string value - [CSHARP-5106](https://jira.mongodb.org/browse/CSHARP-5106)
+ Fix translation issue during serialization of numbers with differing sizes - [CSHARP-5163](https://jira.mongodb.org/browse/CSHARP-5163)
+ Support Linux distros using libdl.so.2 [CSHARP-4889](https://jira.mongodb.org/browse/CSHARP-4889)
+ Multiple bug fixes and improvements.

The full list of issues resolved in this release is available at [CSHARP JIRA project](https://jira.mongodb.org/issues/?jql=project%20%3D%20CSHARP%20AND%20fixVersion%20%3D%202.27.0%20ORDER%20BY%20key%20ASC).

Documentation on the .NET driver can be found [here](https://www.mongodb.com/docs/drivers/csharp/v2.27/).
2 changes: 1 addition & 1 deletion purls.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pkg:nuget/MongoDB.Libmongocrypt@1.9.0
pkg:nuget/MongoDB.Libmongocrypt@1.10.0
16 changes: 8 additions & 8 deletions sbom.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"components": [
{
"bom-ref": "pkg:nuget/MongoDB.Libmongocrypt@1.9.0",
"bom-ref": "pkg:nuget/MongoDB.Libmongocrypt@1.10.0",
"externalReferences": [
{
"type": "distribution",
"url": "https://www.nuget.org/api/v2/package/MongoDB.Libmongocrypt/1.9.0"
"url": "https://www.nuget.org/api/v2/package/MongoDB.Libmongocrypt/1.10.0"
},
{
"type": "website",
"url": "https://www.nuget.org/packages/MongoDB.Libmongocrypt/1.9.0"
"url": "https://www.nuget.org/packages/MongoDB.Libmongocrypt/1.10.0"
}
],
"name": "MongoDB.Libmongocrypt",
"purl": "pkg:nuget/MongoDB.Libmongocrypt@1.9.0",
"purl": "pkg:nuget/MongoDB.Libmongocrypt@1.10.0",
"type": "library",
"version": "1.9.0"
"version": "1.10.0"
}
],
"dependencies": [
{
"ref": "pkg:nuget/MongoDB.Libmongocrypt@1.9.0"
"ref": "pkg:nuget/MongoDB.Libmongocrypt@1.10.0"
}
],
"metadata": {
"timestamp": "2024-05-23T20:46:09.160033+00:00",
"timestamp": "2024-06-27T18:41:56.248350+00:00",
"tools": [
{
"externalReferences": [
Expand Down Expand Up @@ -67,7 +67,7 @@
}
]
},
"serialNumber": "urn:uuid:77687498-fcba-4e54-880d-67b3b53d41af",
"serialNumber": "urn:uuid:cb433355-beb9-4038-8a04-565191eff5c5",
"version": 1,
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
"bomFormat": "CycloneDX",
Expand Down
3 changes: 1 addition & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://www.mongodb.com/docs/drivers/csharp/</PackageProjectUrl>
<PackageTags>mongodb;mongo;nosql</PackageTags>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageLanguage>en-US</PackageLanguage>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down Expand Up @@ -49,7 +49,6 @@
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="$(PackageLicenseFile)" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
4 changes: 3 additions & 1 deletion src/MongoDB.Bson/Etherna.MongoDB.Bson.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
</ItemGroup>

<ItemGroup>
<Compile Include="..\MongoDB.Shared\Hasher.cs" Link="Hasher.cs" />
<Compile Include="..\MongoDB.Shared\DictionaryComparer.cs" Link="Shared\DictionaryComparer.cs" />
<Compile Include="..\MongoDB.Shared\Hasher.cs" Link="Shared\Hasher.cs" />
<Compile Include="..\MongoDB.Shared\SequenceComparer.cs" Link="Shared\SequenceComparer.cs" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/MongoDB.Bson/IO/JsonReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1961,13 +1961,13 @@ private BsonValue ParseTimestampConstructor()
VerifyToken(",");
int increment;
var incrementToken = PopToken();
if (secondsSinceEpochToken.IsNumber)
if (incrementToken.IsNumber)
{
increment = incrementToken.Int32Value;
}
else
{
var message = string.Format("JSON reader expected a number but found '{0}'.", secondsSinceEpochToken.Lexeme);
var message = string.Format("JSON reader expected a number but found '{0}'.", incrementToken.Lexeme);
throw new FormatException(message);
}
VerifyToken(")");
Expand Down
31 changes: 30 additions & 1 deletion src/MongoDB.Bson/Serialization/BsonClassMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using Etherna.MongoDB.Bson.IO;
using Etherna.MongoDB.Bson.Serialization.Conventions;
using Etherna.MongoDB.Shared;

namespace Etherna.MongoDB.Bson.Serialization
{
Expand Down Expand Up @@ -542,6 +542,35 @@ public object CreateInstance()
return creator.Invoke();
}

/// <inheritdoc/>
public override bool Equals(object obj)
{
if (object.ReferenceEquals(obj, null)) { return false; }
if (object.ReferenceEquals(this, obj)) { return true; }
return
GetType().Equals(obj.GetType()) &&
obj is BsonClassMap other &&
_frozen.Equals(true) && other._frozen.Equals(true) && // BsonClassMaps should only be equal if they are frozen
object.Equals(_baseClassMap, other._baseClassMap) &&
object.Equals(_classType, other._classType) &&
object.Equals(_creator, other._creator) &&
SequenceComparer.Equals(_creatorMaps, other._creatorMaps) &&
SequenceComparer.Equals(_declaredMemberMaps, other._declaredMemberMaps) &&
object.Equals(_discriminator, other._discriminator) &&
_discriminatorIsRequired.Equals(other._discriminatorIsRequired) &&
_extraElementsMemberIndex.Equals(other._extraElementsMemberIndex) &&
object.Equals(_extraElementsMemberMap, other._extraElementsMemberMap) &&
_hasRootClass.Equals(other._hasRootClass) &&
object.Equals(_idMemberMap, other._idMemberMap) &&
_ignoreExtraElements.Equals(other._ignoreExtraElements) &&
_ignoreExtraElementsIsInherited.Equals(other._ignoreExtraElementsIsInherited) &&
_isRootClass.Equals(other._isRootClass) &&
SequenceComparer.Equals(_knownTypes, other._knownTypes);
}

/// <inheritdoc/>
public override int GetHashCode() => 0;

/// <summary>
/// Freezes the class map.
/// </summary>
Expand Down
26 changes: 26 additions & 0 deletions src/MongoDB.Bson/Serialization/BsonMemberMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,32 @@ public void Freeze()
_frozen = true;
}

/// <inheritdoc/>
public override bool Equals(object obj)
{
if (object.ReferenceEquals(obj, null)) { return false; }
if (object.ReferenceEquals(this, obj)) { return true; }
return
GetType().Equals(obj.GetType()) &&
obj is BsonMemberMap other &&
_frozen.Equals(true) && other._frozen.Equals(true) && // BsonMemberMaps should only be equal if they are frozen
object.Equals(_defaultValue, other._defaultValue) &&
object.Equals(_defaultValueCreator, other._defaultValueCreator) &&
_defaultValueSpecified.Equals(other._defaultValueSpecified) &&
object.Equals(_elementName, other._elementName) &&
object.Equals(_idGenerator, other._idGenerator) &&
_ignoreIfDefault.Equals(other._ignoreIfDefault) &&
_ignoreIfNull.Equals(other._ignoreIfNull) &&
_isRequired.Equals(other._isRequired) &&
object.Equals(_memberInfo, other._memberInfo) &&
_order.Equals(other._order) &&
object.Equals(_serializer, other._serializer) &&
object.Equals(_shouldSerializeMethod, other._shouldSerializeMethod);
}

/// <inheritdoc/>
public override int GetHashCode() => 0;

/// <summary>
/// Gets the serializer.
/// </summary>
Expand Down
17 changes: 17 additions & 0 deletions src/MongoDB.Bson/Serialization/BsonSerializationInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,23 @@ public object DeserializeValue(BsonValue value)
}
}

/// <inheritdoc/>
public override bool Equals(object obj)
{
if (object.ReferenceEquals(obj, null)) { return false; }
if (object.ReferenceEquals(this, obj)) { return true; }
return
GetType().Equals(obj.GetType()) &&
obj is BsonSerializationInfo other &&
object.Equals(_elementName, other._elementName) &&
object.Equals(_elementPath, other._elementPath) &&
object.Equals(_nominalType, other._nominalType) &&
object.Equals(_serializer, other._serializer);
}

/// <inheritdoc/>
public override int GetHashCode() => 0;

/// <summary>
/// Merges the new BsonSerializationInfo by taking its properties and concatenating its ElementName.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ public string ElementName
}

// public methods
/// <inheritdoc/>
public override bool Equals(object obj)
{
if (object.ReferenceEquals(obj, null)) { return false; }
if (object.ReferenceEquals(this, obj)) { return true; }
return
GetType().Equals(obj.GetType()) &&
obj is ObjectDiscriminatorConvention other &&
object.Equals(_elementName, other._elementName);
}

/// <summary>
/// Gets the actual type of an object by reading the discriminator from a BsonReader.
/// </summary>
Expand Down Expand Up @@ -143,5 +154,8 @@ public BsonValue GetDiscriminator(Type nominalType, Type actualType)
{
return TypeNameDiscriminator.GetDiscriminator(actualType);
}

/// <inheritdoc/>
public override int GetHashCode() => 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ public string ElementName
}

// public methods
/// <inheritdoc/>
public override bool Equals(object obj)
{
if (object.ReferenceEquals(obj, null)) { return false; }
if (object.ReferenceEquals(this, obj)) { return true; }
return
GetType().Equals(obj.GetType()) &&
obj is StandardDiscriminatorConvention other &&
object.Equals(_elementName, other._elementName);
}

/// <summary>
/// Gets the actual type of an object by reading the discriminator from a BsonReader.
/// </summary>
Expand Down Expand Up @@ -123,5 +134,8 @@ public Type GetActualType(IBsonReader bsonReader, Type nominalType)
/// <param name="actualType">The actual type.</param>
/// <returns>The discriminator value.</returns>
public abstract BsonValue GetDiscriminator(Type nominalType, Type actualType);

/// <inheritdoc/>
public override int GetHashCode() => 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/

using System;
using Etherna.MongoDB.Bson.Serialization.Attributes;

namespace Etherna.MongoDB.Bson.Serialization.Options
{
Expand Down Expand Up @@ -57,6 +56,21 @@ public bool AllowTruncation
}

// public methods
/// <inheritdoc/>
public override bool Equals(object obj)
{
if (object.ReferenceEquals(obj, null)) { return false; }
if (object.ReferenceEquals(this, obj)) { return true; }
return
GetType().Equals(obj.GetType()) &&
obj is RepresentationConverter other &&
_allowOverflow.Equals(other._allowOverflow) &&
_allowTruncation.Equals(other._allowTruncation);
}

/// <inheritdoc/>
public override int GetHashCode() => 0;

/// <summary>
/// Converts a Decimal128 to a Decimal.
/// </summary>
Expand Down
18 changes: 16 additions & 2 deletions src/MongoDB.Bson/Serialization/Serializers/BitArraySerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ private static class Flags

// private fields
private readonly SerializerHelper _helper;
private readonly Int32Serializer _int32Serializer = new Int32Serializer();
private readonly BsonType _representation;

// constructors
Expand Down Expand Up @@ -85,6 +84,21 @@ public BsonType Representation
}

// public methods
/// <inheritdoc/>
public override bool Equals(object obj)
{
if (object.ReferenceEquals(obj, null)) { return false; }
if (object.ReferenceEquals(this, obj)) { return true; }
return
base.Equals(obj) &&
obj is BitArraySerializer other &&
_representation.Equals(other._representation);
}

/// <inheritdoc/>
public override int GetHashCode() => 0;

// protected methods
#pragma warning disable 618 // about obsolete BsonBinarySubType.OldBinary
/// <summary>
/// Deserializes a value.
Expand All @@ -110,7 +124,7 @@ protected override BitArray DeserializeValue(BsonDeserializationContext context,
{
switch (flag)
{
case Flags.Length: length = _int32Serializer.Deserialize(context); break;
case Flags.Length: length = Int32Serializer.Instance.Deserialize(context); break;
case Flags.Bytes: bytes = bsonReader.ReadBytes(); break;
}
});
Expand Down
14 changes: 14 additions & 0 deletions src/MongoDB.Bson/Serialization/Serializers/BooleanSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ public override bool Deserialize(BsonDeserializationContext context, BsonDeseria
}
}

/// <inheritdoc/>
public override bool Equals(object obj)
{
if (object.ReferenceEquals(obj, null)) { return false; }
if (object.ReferenceEquals(this, obj)) { return true; }
return
base.Equals(obj) &&
obj is BooleanSerializer other &&
_representation.Equals(other._representation);
}

/// <inheritdoc/>
public override int GetHashCode() => 0;

/// <summary>
/// Serializes a value.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* limitations under the License.
*/


namespace Etherna.MongoDB.Bson.Serialization.Serializers
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* limitations under the License.
*/


namespace Etherna.MongoDB.Bson.Serialization.Serializers
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* limitations under the License.
*/


namespace Etherna.MongoDB.Bson.Serialization.Serializers
{
/// <summary>
Expand Down
Loading

0 comments on commit b4a67f5

Please sign in to comment.