RawBsonDocument ClassMongoDB C# Driver API Documentation
Represents an immutable BSON document that is represented using only the raw bytes.
Inheritance Hierarchy

SystemObject
  MongoDB.BsonBsonValue
    MongoDB.BsonBsonDocument
      MongoDB.BsonRawBsonDocument

Namespace: MongoDB.Bson
Assembly: MongoDB.Bson (in MongoDB.Bson.dll) Version: { version: '1.11.0.92', semver: '1.11.0', commit: '791a16588d4a8b3b118a8b3b57cfa436fec5d3da', commitDate: '2015-12-08 22:55:45' }
Syntax

[SerializableAttribute]
public class RawBsonDocument : BsonDocument, 
	IDisposable

The RawBsonDocument type exposes the following members.

Constructors

  NameDescription
Public methodRawBsonDocument(Byte)
Initializes a new instance of the RawBsonDocument class.
Public methodRawBsonDocument(IByteBuffer)
Initializes a new instance of the RawBsonDocument class.
Top
Methods

  NameDescription
Public methodAdd(DictionaryString, Object) Obsolete.
Adds elements to the document from a dictionary of key/value pairs.
(Overrides BsonDocumentAdd(DictionaryString, Object).)
Public methodAdd(IDictionaryString, Object) Obsolete.
Adds elements to the document from a dictionary of key/value pairs.
(Overrides BsonDocumentAdd(IDictionaryString, Object).)
Public methodAdd(IDictionary) Obsolete.
Adds elements to the document from a dictionary of key/value pairs.
(Overrides BsonDocumentAdd(IDictionary).)
Public methodAdd(BsonElement)
Adds an element to the document.
(Overrides BsonDocumentAdd(BsonElement).)
Public methodAdd(BsonElement) Obsolete.
Adds a list of elements to the document.
(Overrides BsonDocumentAdd(BsonElement).)
Public methodAdd(IEnumerableBsonElement) Obsolete.
Adds a list of elements to the document.
(Overrides BsonDocumentAdd(IEnumerableBsonElement).)
Public methodAdd(DictionaryString, Object, IEnumerableString) Obsolete.
Adds elements to the document from a dictionary of key/value pairs.
(Overrides BsonDocumentAdd(DictionaryString, Object, IEnumerableString).)
Public methodAdd(IDictionaryString, Object, IEnumerableString) Obsolete.
Adds elements to the document from a dictionary of key/value pairs.
(Overrides BsonDocumentAdd(IDictionaryString, Object, IEnumerableString).)
Public methodAdd(IDictionary, IEnumerable) Obsolete.
Adds elements to the document from a dictionary of key/value pairs.
(Overrides BsonDocumentAdd(IDictionary, IEnumerable).)
Public methodAdd(String, BsonValue)
Creates and adds an element to the document.
(Overrides BsonDocumentAdd(String, BsonValue).)
Public methodAdd(String, FuncBsonValue, Boolean)
Creates and adds an element to the document, but only if the condition is true. If the condition is false the value factory is not called at all.
(Inherited from BsonDocument.)
Public methodAdd(String, BsonValue, Boolean)
Creates and adds an element to the document, but only if the condition is true.
(Overrides BsonDocumentAdd(String, BsonValue, Boolean).)
Public methodAddRange(DictionaryString, Object)
Adds elements to the document from a dictionary of key/value pairs.
(Overrides BsonDocumentAddRange(DictionaryString, Object).)
Public methodAddRange(IEnumerableKeyValuePairString, Object)
Adds elements to the document from a dictionary of key/value pairs.
(Overrides BsonDocumentAddRange(IEnumerableKeyValuePairString, Object).)
Public methodAddRange(IDictionary)
Adds elements to the document from a dictionary of key/value pairs.
(Overrides BsonDocumentAddRange(IDictionary).)
Public methodAddRange(IEnumerableBsonElement)
Adds a list of elements to the document.
(Overrides BsonDocumentAddRange(IEnumerableBsonElement).)
Public methodClear
Clears the document (removes all elements).
(Overrides BsonDocumentClear.)
Public methodClone
Creates a shallow clone of the document (see also DeepClone).
(Overrides BsonDocumentClone.)
Public methodCompareTo(BsonDocument)
Compares this document to another document.
(Inherited from BsonDocument.)
Public methodCompareTo(BsonValue)
Compares the BsonDocument to another BsonValue.
(Inherited from BsonDocument.)
Public methodCompareTypeTo
Compares the type of this BsonValue to the type of another BsonValue.
(Inherited from BsonValue.)
Public methodContains
Tests whether the document contains an element with the specified name.
(Overrides BsonDocumentContains(String).)
Public methodContainsValue
Tests whether the document contains an element with the specified value.
(Overrides BsonDocumentContainsValue(BsonValue).)
Public methodDeepClone
Creates a deep clone of the document (see also Clone).
(Overrides BsonDocumentDeepClone.)
Public methodDeserialize Obsolete.
Deserializes the document from a BsonReader.
(Inherited from BsonDocument.)
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Public methodEquals(Object)
Compares this BsonDocument to another object.
(Inherited from BsonDocument.)
Public methodEquals(BsonDocument)
Compares this document to another document.
(Inherited from BsonDocument.)
Public methodEquals(BsonValue)
Compares this BsonValue to another BsonValue.
(Inherited from BsonValue.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetDocumentId Obsolete.
Gets the Id of the document.
(Inherited from BsonDocument.)
Public methodGetElement(Int32)
Gets an element of this document.
(Overrides BsonDocumentGetElement(Int32).)
Public methodGetElement(String)
Gets an element of this document.
(Overrides BsonDocumentGetElement(String).)
Public methodGetEnumerator
Gets an enumerator that can be used to enumerate the elements of this document.
(Overrides BsonDocumentGetEnumerator.)
Public methodGetHashCode
Gets the hash code.
(Inherited from BsonDocument.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Public methodGetValue(Int32)
Gets the value of an element.
(Overrides BsonDocumentGetValue(Int32).)
Public methodGetValue(String)
Gets the value of an element.
(Overrides BsonDocumentGetValue(String).)
Public methodGetValue(String, BsonValue)
Gets the value of an element or a default value if the element is not found.
(Overrides BsonDocumentGetValue(String, BsonValue).)
Public methodInsertAt
Inserts a new element at a specified position.
(Overrides BsonDocumentInsertAt(Int32, BsonElement).)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMerge(BsonDocument)
Merges another document into this one. Existing elements are not overwritten.
(Overrides BsonDocumentMerge(BsonDocument).)
Public methodMerge(BsonDocument, Boolean)
Merges another document into this one, specifying whether existing elements are overwritten.
(Overrides BsonDocumentMerge(BsonDocument, Boolean).)
Protected methodOperatorEqualsImplementation
Implementation of operator ==.
(Inherited from BsonValue.)
Public methodRemove
Removes an element from this document (if duplicate element names are allowed then all elements with this name will be removed).
(Overrides BsonDocumentRemove(String).)
Public methodRemoveAt
Removes an element from this document.
(Overrides BsonDocumentRemoveAt(Int32).)
Public methodRemoveElement
Removes an element from this document.
(Overrides BsonDocumentRemoveElement(BsonElement).)
Public methodSerialize Obsolete.
Serializes this document to a BsonWriter.
(Inherited from BsonDocument.)
Public methodSet(Int32, BsonValue)
Sets the value of an element.
(Overrides BsonDocumentSet(Int32, BsonValue).)
Public methodSet(String, BsonValue)
Sets the value of an element (an element will be added if no element with this name is found).
(Overrides BsonDocumentSet(String, BsonValue).)
Public methodSetDocumentId Obsolete.
Sets the document Id.
(Inherited from BsonDocument.)
Public methodSetElement(BsonElement)
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).
(Overrides BsonDocumentSetElement(BsonElement).)
Public methodSetElement(Int32, BsonElement)
Sets an element of the document (replacing the existing element at that position).
(Overrides BsonDocumentSetElement(Int32, BsonElement).)
Protected methodThrowIfDisposed
Throws if disposed.
Public methodToBoolean
Converts this BsonValue to a Boolean (using the JavaScript definition of truthiness).
(Inherited from BsonValue.)
Public methodToDictionary
Converts the BsonDocument to a Dictionary<string, object>.
(Inherited from BsonDocument.)
Public methodToDouble
Converts this BsonValue to a Double.
(Inherited from BsonValue.)
Public methodToHashtable
Converts the BsonDocument to a Hashtable.
(Inherited from BsonDocument.)
Public methodToInt32
Converts this BsonValue to an Int32.
(Inherited from BsonValue.)
Public methodToInt64
Converts this BsonValue to an Int64.
(Inherited from BsonValue.)
Public methodToLocalTime
Converts this BsonValue to a DateTime in local time.
(Inherited from BsonValue.)
Public methodToNullableLocalTime
Converts this BsonValue to a DateTime? in local time.
(Inherited from BsonValue.)
Public methodToNullableUniversalTime
Converts this BsonValue to a DateTime? in UTC.
(Inherited from BsonValue.)
Public methodToString
Returns a string representation of the document.
(Inherited from BsonDocument.)
Public methodToUniversalTime
Converts this BsonValue to a DateTime in UTC.
(Inherited from BsonValue.)
Public methodTryGetElement
Tries to get an element of this document.
(Overrides BsonDocumentTryGetElement(String, BsonElement).)
Public methodTryGetValue
Tries to get the value of an element of this document.
(Overrides BsonDocumentTryGetValue(String, BsonValue).)
Public methodWriteTo(Stream) Obsolete.
Writes the document to a Stream.
(Inherited from BsonDocument.)
Public methodWriteTo(String) Obsolete.
Writes the document to a file.
(Inherited from BsonDocument.)
Public methodWriteTo(BsonBuffer) Obsolete.
Writes the document to a BsonBuffer.
(Inherited from BsonDocument.)
Public methodWriteTo(BsonWriter) Obsolete.
Writes the document to a BsonWriter.
(Inherited from BsonDocument.)
Top
Extension Methods

  NameDescription
Public Extension MethodToBson(Type)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, BsonBinaryWriterSettings)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, IBsonSerializationOptions, BsonBinaryWriterSettings)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument(Type)Overloaded.
Converts an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, JsonWriterSettings)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, IBsonSerializationOptions, JsonWriterSettings)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Top
Properties

  NameDescription
Public propertyAllowDuplicateNames
Gets or sets whether to allow duplicate names (allowing duplicate names is not recommended).
(Inherited from BsonDocument.)
Public propertyAsBoolean
Casts the BsonValue to a Boolean (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonArray
Casts the BsonValue to a BsonArray (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonBinaryData
Casts the BsonValue to a BsonBinaryData (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonDateTime
Casts the BsonValue to a BsonDateTime (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonDocument
Casts the BsonValue to a BsonDocument (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonJavaScript
Casts the BsonValue to a BsonJavaScript (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonJavaScriptWithScope
Casts the BsonValue to a BsonJavaScriptWithScope (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonMaxKey
Casts the BsonValue to a BsonMaxKey (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonMinKey
Casts the BsonValue to a BsonMinKey (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonNull
Casts the BsonValue to a BsonNull (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonRegularExpression
Casts the BsonValue to a BsonRegularExpression (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonSymbol
Casts the BsonValue to a BsonSymbol (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonTimestamp
Casts the BsonValue to a BsonTimestamp (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonUndefined
Casts the BsonValue to a BsonUndefined (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsBsonValue
Casts the BsonValue to a BsonValue (a way of upcasting subclasses of BsonValue to BsonValue at compile time).
(Inherited from BsonValue.)
Public propertyAsByteArray
Casts the BsonValue to a Byte[] (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsDateTime Obsolete.
Casts the BsonValue to a DateTime in UTC (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsDouble
Casts the BsonValue to a Double (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsGuid
Casts the BsonValue to a Guid (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsInt32
Casts the BsonValue to an Int32 (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsInt64
Casts the BsonValue to a Int64 (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsLocalTime Obsolete.
Casts the BsonValue to a DateTime in the local timezone (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsNullableBoolean
Casts the BsonValue to a Nullable{Boolean} (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsNullableDateTime Obsolete.
Casts the BsonValue to a Nullable{DateTime} (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsNullableDouble
Casts the BsonValue to a Nullable{Double} (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsNullableGuid
Casts the BsonValue to a Nullable{Guid} (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsNullableInt32
Casts the BsonValue to a Nullable{Int32} (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsNullableInt64
Casts the BsonValue to a Nullable{Int64} (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsNullableObjectId
Casts the BsonValue to a Nullable{ObjectId} (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsObjectId
Casts the BsonValue to an ObjectId (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsRegex
Casts the BsonValue to a Regex (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsString
Casts the BsonValue to a String (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyAsUniversalTime Obsolete.
Casts the BsonValue to a DateTime in UTC (throws an InvalidCastException if the cast is not valid).
(Inherited from BsonValue.)
Public propertyBsonType
Gets the BsonType of this BsonValue.
(Inherited from BsonValue.)
Public propertyElementCount
Gets the number of elements.
(Overrides BsonDocumentElementCount.)
Public propertyElements
Gets the elements.
(Overrides BsonDocumentElements.)
Public propertyIsBoolean
Tests whether this BsonValue is a Boolean.
(Inherited from BsonValue.)
Public propertyIsBsonArray
Tests whether this BsonValue is a BsonArray.
(Inherited from BsonValue.)
Public propertyIsBsonBinaryData
Tests whether this BsonValue is a BsonBinaryData.
(Inherited from BsonValue.)
Public propertyIsBsonDateTime
Tests whether this BsonValue is a BsonDateTime.
(Inherited from BsonValue.)
Public propertyIsBsonDocument
Tests whether this BsonValue is a BsonDocument.
(Inherited from BsonValue.)
Public propertyIsBsonJavaScript
Tests whether this BsonValue is a BsonJavaScript.
(Inherited from BsonValue.)
Public propertyIsBsonJavaScriptWithScope
Tests whether this BsonValue is a BsonJavaScriptWithScope.
(Inherited from BsonValue.)
Public propertyIsBsonMaxKey
Tests whether this BsonValue is a BsonMaxKey.
(Inherited from BsonValue.)
Public propertyIsBsonMinKey
Tests whether this BsonValue is a BsonMinKey.
(Inherited from BsonValue.)
Public propertyIsBsonNull
Tests whether this BsonValue is a BsonNull.
(Inherited from BsonValue.)
Public propertyIsBsonRegularExpression
Tests whether this BsonValue is a BsonRegularExpression.
(Inherited from BsonValue.)
Public propertyIsBsonSymbol
Tests whether this BsonValue is a BsonSymbol .
(Inherited from BsonValue.)
Public propertyIsBsonTimestamp
Tests whether this BsonValue is a BsonTimestamp.
(Inherited from BsonValue.)
Public propertyIsBsonUndefined
Tests whether this BsonValue is a BsonUndefined.
(Inherited from BsonValue.)
Public propertyIsDateTime Obsolete.
Tests whether this BsonValue is a DateTime.
(Inherited from BsonValue.)
Public propertyIsDouble
Tests whether this BsonValue is a Double.
(Inherited from BsonValue.)
Public propertyIsGuid
Tests whether this BsonValue is a Guid.
(Inherited from BsonValue.)
Public propertyIsInt32
Tests whether this BsonValue is an Int32.
(Inherited from BsonValue.)
Public propertyIsInt64
Tests whether this BsonValue is an Int64.
(Inherited from BsonValue.)
Public propertyIsNumeric
Tests whether this BsonValue is a numeric value.
(Inherited from BsonValue.)
Public propertyIsObjectId
Tests whether this BsonValue is an ObjectId .
(Inherited from BsonValue.)
Public propertyIsString
Tests whether this BsonValue is a String.
(Inherited from BsonValue.)
Public propertyIsValidDateTime
Tests whether this BsonValue is a valid DateTime.
(Inherited from BsonValue.)
Public propertyItemInt32
Gets or sets a value by position.
(Overrides BsonDocumentItemInt32.)
Public propertyItemString
Gets or sets a value by name.
(Overrides BsonDocumentItemString.)
Public propertyItemString, BsonValue Obsolete.
Gets the value of an element or a default value if the element is not found.
(Overrides BsonDocumentItemString, BsonValue.)
Public propertyNames
Gets the element names.
(Overrides BsonDocumentNames.)
Public propertyRawValue Obsolete.
Gets the raw value of this BsonValue (or null if this BsonValue doesn't have a single scalar value).
(Inherited from BsonValue.)
Public propertyRawValues Obsolete.
Gets the raw values (see BsonValue.RawValue).
(Overrides BsonDocumentRawValues.)
Public propertySlice
Gets the slice.
Public propertyValues
Gets the values.
(Overrides BsonDocumentValues.)
Top
See Also

Reference