Skip to content

Commit

Permalink
Fix MongoDB forward compatibility issue caused by deserializing to an…
Browse files Browse the repository at this point in the history
… enum.
  • Loading branch information
s-ludwig committed Feb 7, 2024
1 parent 0381fd8 commit fecff7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mongodb/vibe/db/mongo/collection.d
Expand Up @@ -1477,7 +1477,7 @@ struct MaxWireVersion
MaxWireVersion until(WireVersion v) @safe { return MaxWireVersion(v); }

/// Unsets nullable fields not matching the server version as defined per UDAs.
void enforceWireVersionConstraints(T)(ref T field, WireVersion serverVersion,
void enforceWireVersionConstraints(T)(ref T field, int serverVersion,
string file = __FILE__, size_t line = __LINE__)
@safe {
import std.traits : getUDAs;
Expand Down
5 changes: 3 additions & 2 deletions mongodb/vibe/db/mongo/connection.d
Expand Up @@ -1120,7 +1120,7 @@ struct ServerDescription
Nullable!BsonDate lastWriteDate;
Nullable!BsonObjectID opTime;
ServerType type = ServerType.unknown;
WireVersion minWireVersion, maxWireVersion;
int minWireVersion, maxWireVersion;
string me;
string[] hosts, passives, arbiters;
string[string] tags;
Expand Down Expand Up @@ -1153,7 +1153,8 @@ enum WireVersion : int
v50 = 13,
v51 = 14,
v52 = 15,
v53 = 16
v53 = 16,
v60 = 17
}

private string getHostArchitecture()
Expand Down

0 comments on commit fecff7d

Please sign in to comment.