<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.1" />

Newtonsoft.Json.Bson.BsonDataWriter

public class BsonDataWriter : JsonWriter
Represents a writer that provides a fast, non-cached, forward-only way of generating BSON 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 BsonDataWriter(Stream stream)

Initializes a new instance of the BsonDataWriter class.

Initializes a new instance of the BsonDataWriter 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.