Struct BsonReader
Reads one complete BSON input while enforcing Shard's depth and framing rules.
public readonly ref struct BsonReader
- Inherited Members
Remarks
Binary parsing delegates directly to MongoDB's driver without exposing its types through the public API.
Constructors
BsonReader(ReadOnlyMemory<byte>, int)
public BsonReader(ReadOnlyMemory<byte> source, int maximumDepth = 64)
Parameters
sourceReadOnlyMemory<byte>maximumDepthint
Fields
MaximumSupportedDepth
public const int MaximumSupportedDepth = 64
Field Value
Properties
CurrentType
public BsonType CurrentType { get; }
Property Value
Methods
CaptureBookmark()
Captures both the driver position and Shard's traversal state.
public BsonReader.Bookmark CaptureBookmark()
Returns
Dispose()
public void Dispose()
ReadBinary()
public BsonBinaryValue ReadBinary()
Returns
ReadBoolean()
public bool ReadBoolean()
Returns
ReadDouble()
public double ReadDouble()
Returns
ReadEndArray()
Closes the current array after every item has been consumed.
public void ReadEndArray()
ReadEndDocument()
Closes the current document after every element value has been consumed.
public void ReadEndDocument()
ReadInt32()
public int ReadInt32()
Returns
ReadInt64()
public long ReadInt64()
Returns
ReadNull()
public void ReadNull()
ReadStartArray()
Opens the array at the current value.
public void ReadStartArray()
ReadStartDocument()
Opens the current document value, or the root document when no frame is active.
public void ReadStartDocument()
ReadString()
public string ReadString()
Returns
ReadUtcDateTime()
public long ReadUtcDateTime()
Returns
Restore(in Bookmark)
Returns to a bookmark created by this reader.
public void Restore(in BsonReader.Bookmark bookmark)
Parameters
bookmarkBsonReader.Bookmark
SkipValue()
Consumes the current value and checks nested payloads instead of seeking past their bytes.
public void SkipValue()
TryReadArrayValue()
Advances to the next array item and leaves the reader positioned on its value.
public bool TryReadArrayValue()
Returns
TryReadElement(out string)
Advances to the next document element and leaves the reader positioned on its value.
public bool TryReadElement(out string name)
Parameters
namestring