<PackageReference Include="Newtonsoft.Json" Version="4.0.3" />

BsonWriter

public class BsonWriter : JsonWriter
Represents a writer that provides a fast, non-cached, forward-only way of generating Json data.
public DateTimeKind DateTimeKindHandling { get; set; }

Gets or sets the DateTimeKind used when writing DateTime values to BSON. When set to Unspecified no conversion will occur.

public BsonWriter(Stream stream)

Initializes a new instance of the BsonWriter class.

public void WriteObjectId(byte[] value)

Writes a Byte[] value that represents a BSON object id.

public void WriteRegex(string pattern, string options)

Writes a BSON regex.