Table of Contents

Interface IBsonWriter

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

Represents a BSON writer.

public interface IBsonWriter : IDisposable
Inherited Members
Extension Methods

Properties

Position

Gets the position. Not all writers are able to report the position. Those that can't simply return zero.

long Position { get; }

Property Value

long

The position.

See Also

SerializationDepth

Gets the current serialization depth.

int SerializationDepth { get; }

Property Value

int
See Also

Settings

Gets the settings of the writer.

BsonWriterSettings Settings { get; }

Property Value

BsonWriterSettings
See Also

State

Gets the current state of the writer.

BsonWriterState State { get; }

Property Value

BsonWriterState
See Also

Methods

Close()

Closes the writer.

void Close()
See Also

Flush()

Flushes any pending data to the output destination.

void Flush()
See Also

PopElementNameValidator()

Pops the element name validator.

void PopElementNameValidator()
See Also

PopSettings()

Pops the settings.

void PopSettings()
See Also

PushElementNameValidator(IElementNameValidator)

Pushes the element name validator.

void PushElementNameValidator(IElementNameValidator validator)

Parameters

validator IElementNameValidator

The validator.

See Also

PushSettings(Action<BsonWriterSettings>)

Pushes new settings for the writer.

void PushSettings(Action<BsonWriterSettings> configurator)

Parameters

configurator Action<BsonWriterSettings>

The settings configurator.

See Also

WriteBinaryData(BsonBinaryData)

Writes BSON binary data to the writer.

void WriteBinaryData(BsonBinaryData binaryData)

Parameters

binaryData BsonBinaryData

The binary data.

See Also

WriteBoolean(bool)

Writes a BSON Boolean to the writer.

void WriteBoolean(bool value)

Parameters

value bool

The Boolean value.

See Also

WriteBytes(byte[])

Writes BSON binary data to the writer.

void WriteBytes(byte[] bytes)

Parameters

bytes byte[]

The bytes.

See Also

WriteDateTime(long)

Writes a BSON DateTime to the writer.

void WriteDateTime(long value)

Parameters

value long

The number of milliseconds since the Unix epoch.

See Also

WriteDecimal128(Decimal128)

Writes a BSON Decimal128 to the writer.

void WriteDecimal128(Decimal128 value)

Parameters

value Decimal128

The Decimal128 value.

See Also

WriteDouble(double)

Writes a BSON Double to the writer.

void WriteDouble(double value)

Parameters

value double

The Double value.

See Also

WriteEndArray()

Writes the end of a BSON array to the writer.

void WriteEndArray()
See Also

WriteEndDocument()

Writes the end of a BSON document to the writer.

void WriteEndDocument()
See Also

WriteInt32(int)

Writes a BSON Int32 to the writer.

void WriteInt32(int value)

Parameters

value int

The Int32 value.

See Also

WriteInt64(long)

Writes a BSON Int64 to the writer.

void WriteInt64(long value)

Parameters

value long

The Int64 value.

See Also

WriteJavaScript(string)

Writes a BSON JavaScript to the writer.

void WriteJavaScript(string code)

Parameters

code string

The JavaScript code.

See Also

WriteJavaScriptWithScope(string)

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

void WriteJavaScriptWithScope(string code)

Parameters

code string

The JavaScript code.

See Also

WriteMaxKey()

Writes a BSON MaxKey to the writer.

void WriteMaxKey()
See Also

WriteMinKey()

Writes a BSON MinKey to the writer.

void WriteMinKey()
See Also

WriteName(string)

Writes the name of an element to the writer.

void WriteName(string name)

Parameters

name string

The name of the element.

See Also

WriteNull()

Writes a BSON null to the writer.

void WriteNull()
See Also

WriteObjectId(ObjectId)

Writes a BSON ObjectId to the writer.

void WriteObjectId(ObjectId objectId)

Parameters

objectId ObjectId

The ObjectId.

See Also

WriteRawBsonArray(IByteBuffer)

Writes a raw BSON array.

void WriteRawBsonArray(IByteBuffer slice)

Parameters

slice IByteBuffer

The byte buffer containing the raw BSON array.

See Also

WriteRawBsonDocument(IByteBuffer)

Writes a raw BSON document.

void WriteRawBsonDocument(IByteBuffer slice)

Parameters

slice IByteBuffer

The byte buffer containing the raw BSON document.

See Also

WriteRegularExpression(BsonRegularExpression)

Writes a BSON regular expression to the writer.

void WriteRegularExpression(BsonRegularExpression regex)

Parameters

regex BsonRegularExpression

A BsonRegularExpression.

See Also

WriteStartArray()

Writes the start of a BSON array to the writer.

void WriteStartArray()
See Also

WriteStartDocument()

Writes the start of a BSON document to the writer.

void WriteStartDocument()
See Also

WriteString(string)

Writes a BSON String to the writer.

void WriteString(string value)

Parameters

value string

The String value.

See Also

WriteSymbol(string)

Writes a BSON Symbol to the writer.

void WriteSymbol(string value)

Parameters

value string

The symbol.

See Also

WriteTimestamp(long)

Writes a BSON timestamp to the writer.

void WriteTimestamp(long value)

Parameters

value long

The combined timestamp/increment value.

See Also

WriteUndefined()

Writes a BSON undefined to the writer.

void WriteUndefined()
See Also

See Also