Table of Contents

Method CompareTopologyVersion

Namespace
MongoDB.Driver.Core.Servers
Assembly
MongoDB.Driver.Core.dll

CompareTopologyVersion(TopologyVersion, TopologyVersion)

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.

public static int CompareTopologyVersion(TopologyVersion x, TopologyVersion y)

Parameters

x TopologyVersion

The first TopologyVersion.

y TopologyVersion

The other TopologyVersion.

Returns

int

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.