Table of Contents

Interface IBsonReader

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

Represents a BSON reader.

public interface IBsonReader : IDisposable
Inherited Members
Extension Methods

Properties

CurrentBsonType

Gets the current BsonType.

BsonType CurrentBsonType { get; }

Property Value

BsonType

State

Gets the current state of the reader.

BsonReaderState State { get; }

Property Value

BsonReaderState

Methods

Close()

Closes the reader.

void Close()

GetBookmark()

Gets a bookmark to the reader's current position and state.

BsonReaderBookmark GetBookmark()

Returns

BsonReaderBookmark

A bookmark.

GetCurrentBsonType()

Gets the current BsonType (calls ReadBsonType if necessary).

BsonType GetCurrentBsonType()

Returns

BsonType

The current BsonType.

IsAtEndOfFile()

Determines whether this reader is at end of file.

bool IsAtEndOfFile()

Returns

bool

Whether this reader is at end of file.

PopSettings()

Pops the settings.

void PopSettings()

PushSettings(Action<BsonReaderSettings>)

Pushes new settings for the reader.

void PushSettings(Action<BsonReaderSettings> configurator)

Parameters

configurator Action<BsonReaderSettings>

The settings configurator.

ReadBinaryData()

Reads BSON binary data from the reader.

BsonBinaryData ReadBinaryData()

Returns

BsonBinaryData

A BsonBinaryData.

ReadBoolean()

Reads a BSON boolean from the reader.

bool ReadBoolean()

Returns

bool

A Boolean.

ReadBsonType()

Reads a BsonType from the reader.

BsonType ReadBsonType()

Returns

BsonType

A BsonType.

ReadBytes()

Reads BSON binary data from the reader.

byte[] ReadBytes()

Returns

byte[]

A byte array.

ReadDateTime()

Reads a BSON DateTime from the reader.

long ReadDateTime()

Returns

long

The number of milliseconds since the Unix epoch.

ReadDecimal128()

Reads a BSON Decimal128 from the reader.

Decimal128 ReadDecimal128()

Returns

Decimal128

A Decimal128.

ReadDouble()

Reads a BSON Double from the reader.

double ReadDouble()

Returns

double

A Double.

ReadEndArray()

Reads the end of a BSON array from the reader.

void ReadEndArray()

ReadEndDocument()

Reads the end of a BSON document from the reader.

void ReadEndDocument()

ReadInt32()

Reads a BSON Int32 from the reader.

int ReadInt32()

Returns

int

An Int32.

ReadInt64()

Reads a BSON Int64 from the reader.

long ReadInt64()

Returns

long

An Int64.

ReadJavaScript()

Reads a BSON JavaScript from the reader.

string ReadJavaScript()

Returns

string

A string.

ReadJavaScriptWithScope()

Reads a BSON JavaScript with scope from the reader (call ReadStartDocument next to read the scope).

string ReadJavaScriptWithScope()

Returns

string

A string.

ReadMaxKey()

Reads a BSON MaxKey from the reader.

void ReadMaxKey()

ReadMinKey()

Reads a BSON MinKey from the reader.

void ReadMinKey()

ReadName(INameDecoder)

Reads the name of an element from the reader (using the provided name decoder).

string ReadName(INameDecoder nameDecoder)

Parameters

nameDecoder INameDecoder

The name decoder.

Returns

string

The name of the element.

ReadNull()

Reads a BSON null from the reader.

void ReadNull()

ReadObjectId()

Reads a BSON ObjectId from the reader.

ObjectId ReadObjectId()

Returns

ObjectId

An ObjectId.

ReadRawBsonArray()

Reads a raw BSON array.

IByteBuffer ReadRawBsonArray()

Returns

IByteBuffer

The raw BSON array.

ReadRawBsonDocument()

Reads a raw BSON document.

IByteBuffer ReadRawBsonDocument()

Returns

IByteBuffer

The raw BSON document.

ReadRegularExpression()

Reads a BSON regular expression from the reader.

BsonRegularExpression ReadRegularExpression()

Returns

BsonRegularExpression

A BsonRegularExpression.

ReadStartArray()

Reads the start of a BSON array.

void ReadStartArray()

ReadStartDocument()

Reads the start of a BSON document.

void ReadStartDocument()

ReadString()

Reads a BSON string from the reader.

string ReadString()

Returns

string

A String.

ReadSymbol()

Reads a BSON symbol from the reader.

string ReadSymbol()

Returns

string

A string.

ReadTimestamp()

Reads a BSON timestamp from the reader.

long ReadTimestamp()

Returns

long

The combined timestamp/increment.

ReadUndefined()

Reads a BSON undefined from the reader.

void ReadUndefined()

ReturnToBookmark(BsonReaderBookmark)

Returns the reader to previously bookmarked position and state.

void ReturnToBookmark(BsonReaderBookmark bookmark)

Parameters

bookmark BsonReaderBookmark

The bookmark.

SkipName()

Skips the name (reader must be positioned on a name).

void SkipName()

SkipValue()

Skips the value (reader must be positioned on a value).

void SkipValue()