Table of Contents

Class IBsonWriterExtensions

Namespace
MongoDB.Bson.IO
Assembly
MongoDB.Bson.dll

Contains extension methods for IBsonWriter.

public static class IBsonWriterExtensions
Inheritance
IBsonWriterExtensions
Inherited Members

Methods

WriteBinaryData(IBsonWriter, string, BsonBinaryData)

Writes a BSON binary data element to the writer.

public static void WriteBinaryData(this IBsonWriter writer, string name, BsonBinaryData binaryData)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

binaryData BsonBinaryData

The binary data.

WriteBoolean(IBsonWriter, string, bool)

Writes a BSON Boolean element to the writer.

public static void WriteBoolean(this IBsonWriter writer, string name, bool value)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

value bool

The Boolean value.

WriteBytes(IBsonWriter, string, byte[])

Writes a BSON binary data element to the writer.

public static void WriteBytes(this IBsonWriter writer, string name, byte[] bytes)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

bytes byte[]

The bytes.

WriteDateTime(IBsonWriter, string, long)

Writes a BSON DateTime element to the writer.

public static void WriteDateTime(this IBsonWriter writer, string name, long value)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

value long

The number of milliseconds since the Unix epoch.

WriteDecimal128(IBsonWriter, string, Decimal128)

Writes a BSON Decimal128 element to the writer.

public static void WriteDecimal128(this IBsonWriter writer, string name, Decimal128 value)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

value Decimal128

The Decimal128 value.

WriteDouble(IBsonWriter, string, double)

Writes a BSON Double element to the writer.

public static void WriteDouble(this IBsonWriter writer, string name, double value)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

value double

The Double value.

WriteInt32(IBsonWriter, string, int)

Writes a BSON Int32 element to the writer.

public static void WriteInt32(this IBsonWriter writer, string name, int value)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

value int

The Int32 value.

WriteInt64(IBsonWriter, string, long)

Writes a BSON Int64 element to the writer.

public static void WriteInt64(this IBsonWriter writer, string name, long value)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

value long

The Int64 value.

WriteJavaScript(IBsonWriter, string, string)

Writes a BSON JavaScript element to the writer.

public static void WriteJavaScript(this IBsonWriter writer, string name, string code)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

code string

The JavaScript code.

WriteJavaScriptWithScope(IBsonWriter, string, string)

Writes a BSON JavaScript element to the writer (call WriteStartDocument to start writing the scope).

public static void WriteJavaScriptWithScope(this IBsonWriter writer, string name, string code)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

code string

The JavaScript code.

WriteMaxKey(IBsonWriter, string)

Writes a BSON MaxKey element to the writer.

public static void WriteMaxKey(this IBsonWriter writer, string name)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

WriteMinKey(IBsonWriter, string)

Writes a BSON MinKey element to the writer.

public static void WriteMinKey(this IBsonWriter writer, string name)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

WriteNull(IBsonWriter, string)

Writes a BSON null element to the writer.

public static void WriteNull(this IBsonWriter writer, string name)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

WriteObjectId(IBsonWriter, string, ObjectId)

Writes a BSON ObjectId element to the writer.

public static void WriteObjectId(this IBsonWriter writer, string name, ObjectId objectId)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

objectId ObjectId

The ObjectId.

WriteRawBsonArray(IBsonWriter, string, IByteBuffer)

Writes a raw BSON array.

public static void WriteRawBsonArray(this IBsonWriter writer, string name, IByteBuffer slice)

Parameters

writer IBsonWriter

The writer.

name string

The name.

slice IByteBuffer

The byte buffer containing the raw BSON array.

WriteRawBsonDocument(IBsonWriter, string, IByteBuffer)

Writes a raw BSON document.

public static void WriteRawBsonDocument(this IBsonWriter writer, string name, IByteBuffer slice)

Parameters

writer IBsonWriter

The writer.

name string

The name.

slice IByteBuffer

The byte buffer containing the raw BSON document.

WriteRegularExpression(IBsonWriter, string, BsonRegularExpression)

Writes a BSON regular expression element to the writer.

public static void WriteRegularExpression(this IBsonWriter writer, string name, BsonRegularExpression regex)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

regex BsonRegularExpression

A BsonRegularExpression.

WriteStartArray(IBsonWriter, string)

Writes the start of a BSON array element to the writer.

public static void WriteStartArray(this IBsonWriter writer, string name)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

WriteStartDocument(IBsonWriter, string)

Writes the start of a BSON document element to the writer.

public static void WriteStartDocument(this IBsonWriter writer, string name)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

WriteString(IBsonWriter, string, string)

Writes a BSON String element to the writer.

public static void WriteString(this IBsonWriter writer, string name, string value)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

value string

The String value.

WriteSymbol(IBsonWriter, string, string)

Writes a BSON Symbol element to the writer.

public static void WriteSymbol(this IBsonWriter writer, string name, string value)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

value string

The symbol.

WriteTimestamp(IBsonWriter, string, long)

Writes a BSON timestamp element to the writer.

public static void WriteTimestamp(this IBsonWriter writer, string name, long value)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.

value long

The combined timestamp/increment value.

WriteUndefined(IBsonWriter, string)

Writes a BSON undefined element to the writer.

public static void WriteUndefined(this IBsonWriter writer, string name)

Parameters

writer IBsonWriter

The writer.

name string

The name of the element.