Table of Contents

Class AscendingGuidGenerator

Namespace
MongoDB.Bson.Serialization.IdGenerators
Assembly
MongoDB.Bson.dll

A GUID generator that generates GUIDs in ascending order. To enable an index to make use of the ascending nature make sure to use GuidRepresentation.Standard as the storage representation. Internally the GUID is of the form 8 bytes: Ticks from DateTime.UtcNow.Ticks 5 bytes: Random value from ObjectId spec 3 bytes: increment

public class AscendingGuidGenerator : IIdGenerator
Inheritance
AscendingGuidGenerator
Implements
Inherited Members
Extension Methods

Properties

Instance

Gets an instance of AscendingGuidGenerator.

Methods

GenerateId(long, byte[], int)

Generates a Guid for a document. Note - this is purely used for unit testing

GenerateId(object, object)

Generates an ascending Guid for a document. Consecutive invocations should generate Guids that are ascending from a MongoDB perspective

IsEmpty(object)

Tests whether an id is empty.