Table of Contents

Class BsonTimestamp

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Represents a BSON timestamp value.

[Serializable]
public class BsonTimestamp : BsonValue, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonTimestamp>, IEquatable<BsonTimestamp>
Inheritance
BsonTimestamp
Implements
Inherited Members
Extension Methods

Constructors

BsonTimestamp(int, int)

Initializes a new instance of the BsonTimestamp class.

public BsonTimestamp(int timestamp, int increment)

Parameters

timestamp int

The timestamp.

increment int

The increment.

BsonTimestamp(long)

Initializes a new instance of the BsonTimestamp class.

public BsonTimestamp(long value)

Parameters

value long

The combined timestamp/increment value.

Properties

BsonType

Gets the BsonType of this BsonValue.

public override BsonType BsonType { get; }

Property Value

BsonType

Increment

Gets the increment.

public int Increment { get; }

Property Value

int

Timestamp

Gets the timestamp.

public int Timestamp { get; }

Property Value

int

Value

Gets the value of this BsonTimestamp.

public long Value { get; }

Property Value

long

Methods

CompareTo(BsonTimestamp)

Compares this BsonTimestamp to another BsonTimestamp.

public int CompareTo(BsonTimestamp other)

Parameters

other BsonTimestamp

The other BsonTimestamp.

Returns

int

A 32-bit signed integer that indicates whether this BsonTimestamp is less than, equal to, or greather than the other.

CompareTo(BsonValue)

Compares the BsonTimestamp to another BsonValue.

public override int CompareTo(BsonValue other)

Parameters

other BsonValue

The other BsonValue.

Returns

int

A 32-bit signed integer that indicates whether this BsonTimestamp is less than, equal to, or greather than the other BsonValue.

Create(object)

Creates a new BsonTimestamp.

public static BsonTimestamp Create(object value)

Parameters

value object

An object to be mapped to a BsonTimestamp.

Returns

BsonTimestamp

A BsonTimestamp or null.

Equals(BsonTimestamp)

Compares this BsonTimestamp to another BsonTimestamp.

public bool Equals(BsonTimestamp rhs)

Parameters

rhs BsonTimestamp

The other BsonTimestamp.

Returns

bool

True if the two BsonTimestamp values are equal.

Equals(object)

Compares this BsonTimestamp to another object.

public override bool Equals(object obj)

Parameters

obj object

The other object.

Returns

bool

True if the other object is a BsonTimestamp and equal to this one.

GetHashCode()

Gets the hash code.

public override int GetHashCode()

Returns

int

The hash code.

ToString()

Returns a string representation of the value.

public override string ToString()

Returns

string

A string representation of the value.

Operators

operator ==(BsonTimestamp, BsonTimestamp)

Compares two BsonTimestamp values.

public static bool operator ==(BsonTimestamp lhs, BsonTimestamp rhs)

Parameters

lhs BsonTimestamp

The first BsonTimestamp.

rhs BsonTimestamp

The other BsonTimestamp.

Returns

bool

True if the two BsonTimestamp values are equal according to ==.

operator !=(BsonTimestamp, BsonTimestamp)

Compares two BsonTimestamp values.

public static bool operator !=(BsonTimestamp lhs, BsonTimestamp rhs)

Parameters

lhs BsonTimestamp

The first BsonTimestamp.

rhs BsonTimestamp

The other BsonTimestamp.

Returns

bool

True if the two BsonTimestamp values are not equal according to ==.