Click or drag to resize

TopologyVersionCompareTopologyVersion Method

Compares a local TopologyVersion with a server's TopologyVersion and indicates whether the local TopologyVersion is staler, fresher, or equal to the server's TopologyVersion. Per the SDAM specification, if the ProcessIds are not equal, this method assumes that y is more recent. This means that this method does not exhibit the reversal properties of inequalities i.e. a "<" b does not imply b ">" a.

Namespace:  MongoDB.Driver.Core.Servers
Assembly:  MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.15.0+f503bf610759c13f78cff9a3c01e91453185d2ed
Syntax
public static int CompareTopologyVersion(
	TopologyVersion x,
	TopologyVersion y
)

Parameters

x
Type: MongoDB.Driver.Core.ServersTopologyVersion
The first TopologyVersion.
y
Type: MongoDB.Driver.Core.ServersTopologyVersion
The other TopologyVersion.

Return Value

Type: Int32
Less than zero indicates that the x is staler than the y. Zero indicates that the x description is equal to the y. Greater than zero indicates that the x is fresher than the y.
See Also