Class RawBsonDocument
Represents an immutable BSON document that is represented using only the raw bytes.
[BsonSerializer(typeof(RawBsonDocumentSerializer))]
public class RawBsonDocument : BsonDocument, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonDocument>, IConvertibleToBsonDocument, IEnumerable<BsonElement>, IEnumerable, IEquatable<BsonDocument>, IDisposable
- Inheritance
-
Raw
Bson Document
- Implements
- Inherited Members
- Extension Methods
Constructors
- Raw
Bson Document(IByte Buffer) Initializes a new instance of the Raw
Bson class.Document
- Raw
Bson Document(byte[]) Initializes a new instance of the Raw
Bson class.Document
Properties
- Element
Count Gets the number of elements.
- Elements
Gets the elements.
- this[int]
Gets or sets a value by position.
- this[string]
Gets or sets a value by name.
- Names
Gets the element names.
- Slice
Gets the slice.
- Values
Gets the values.
Methods
- Add(Bson
Element) Adds an element to the document.
- Add(string,
Bson Value) Creates and adds an element to the document.
- Add(string,
Bson Value, bool) Creates and adds an element to the document, but only if the condition is true.
- AddRange(Dictionary<string, object>)
Adds elements to the document from a dictionary of key/value pairs.
- AddRange(IEnumerable<BsonElement>)
Adds a list of elements to the document.
- AddRange(IEnumerable<KeyValuePair<string, object>>)
Adds elements to the document from a dictionary of key/value pairs.
- Add
Range(IDictionary) Adds elements to the document from a dictionary of key/value pairs.
- Clear()
Clears the document (removes all elements).
- Clone()
Creates a shallow clone of the document (see also DeepClone).
- Contains(string)
Tests whether the document contains an element with the specified name.
- Contains
Value(Bson Value) Tests whether the document contains an element with the specified value.
- Deep
Clone() Creates a deep clone of the document (see also Clone).
- Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- Dispose(bool)
Releases unmanaged and - optionally - managed resources.
- Get
Element(int) Gets an element of this document.
- Get
Element(string) Gets an element of this document.
- Get
Enumerator() Gets an enumerator that can be used to enumerate the elements of this document.
- Get
Value(int) Gets the value of an element.
- Get
Value(string) Gets the value of an element.
- Get
Value(string, Bson Value) Gets the value of an element or a default value if the element is not found.
- Insert
At(int, Bson Element) Inserts a new element at a specified position.
- Materialize(Bson
Binary Reader Settings) Materializes the RawBsonDocument into a regular BsonDocument.
- Merge(Bson
Document) Merges another document into this one. Existing elements are not overwritten.
- Merge(Bson
Document, bool) Merges another document into this one, specifying whether existing elements are overwritten.
- Remove(string)
Removes an element from this document (if duplicate element names are allowed then all elements with this name will be removed).
- Remove
At(int) Removes an element from this document.
- Remove
Element(Bson Element) Removes an element from this document.
- Set(int,
Bson Value) Sets the value of an element.
- Set(string,
Bson Value) Sets the value of an element (an element will be added if no element with this name is found).
- Set
Element(Bson Element) Sets an element of the document (replaces any existing element with the same name or adds a new element if an element with the same name is not found).
- Set
Element(int, Bson Element) Sets an element of the document (replacing the existing element at that position).
- Throw
IfDisposed() Throws if disposed.
- Try
Get Element(string, out Bson Element) Tries to get an element of this document.
- Try
Get Value(string, out Bson Value) Tries to get the value of an element of this document.