Table of Contents

Class BsonObjectId

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Represents a BSON ObjectId value (see also ObjectId).

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

Constructors

BsonObjectId(ObjectId)

Initializes a new instance of the BsonObjectId class.

BsonObjectId(byte[])

Initializes a new instance of the BsonObjectId class.

BsonObjectId(DateTime, int, short, int)

Initializes a new instance of the BsonObjectId class.

BsonObjectId(int, int, short, int)

Initializes a new instance of the BsonObjectId class.

BsonObjectId(string)

Initializes a new instance of the BsonObjectId class.

Properties

BsonType

Gets the BsonType of this BsonValue.

CreationTime

Gets the creation time (derived from the timestamp).

Empty

Gets an instance of BsonObjectId where the value is empty.

Increment

Gets the increment.

Machine

Gets the machine.

Pid

Gets the PID.

RawValue

Gets the BsonObjectId as an ObjectId.

Timestamp

Gets the timestamp.

Value

Gets the value of this BsonObjectId.

Methods

CompareTo(BsonObjectId)

Compares this BsonObjectId to another BsonObjectId.

CompareTo(BsonValue)

Compares the BsonObjectId to another BsonValue.

Create(object)

Creates a new BsonObjectId.

Equals(BsonObjectId)

Compares this BsonObjectId to another BsonObjectId.

Equals(object)

Compares this BsonObjectId to another object.

GenerateNewId()

Generates a new BsonObjectId with a unique value.

GenerateNewId(DateTime)

Generates a new BsonObjectId with a unique value (with the timestamp component based on a given DateTime).

GenerateNewId(int)

Generates a new BsonObjectId with a unique value (with the given timestamp).

GetHashCode()

Gets the hash code.

IConvertibleToStringImplementation(IFormatProvider)

Implementation of the IConvertible ToString method.

Parse(string)

Parses a string and creates a new BsonObjectId.

ToByteArray()

Converts the BsonObjectId to a byte array.

ToString()

Returns a string representation of the value.

TryParse(string, out BsonObjectId)

Tries to parse a string and create a new BsonObjectId.

Operators

operator ==(BsonObjectId, BsonObjectId)

Compares two BsonObjectId values.

implicit operator BsonObjectId(ObjectId)

Converts an ObjectId to a BsonObjectId.

operator !=(BsonObjectId, BsonObjectId)

Compares two BsonObjectId values.