Click or drag to resize

BsonDocumentWriter Class

Represents a BSON writer to a BsonDocument.
Inheritance Hierarchy

Namespace:  MongoDB.Bson.IO
Assembly:  MongoDB.Bson (in MongoDB.Bson.dll) Version: 2.6.0+Branch.origin/v2.6.x.Sha.593796a7b35dc59243383bcc684de296a5468f2e
Syntax
public class BsonDocumentWriter : BsonWriter

The BsonDocumentWriter type exposes the following members.

Constructors
  NameDescription
Public methodBsonDocumentWriter(BsonDocument)
Initializes a new instance of the BsonDocumentWriter class.
Public methodBsonDocumentWriter(BsonDocument, BsonDocumentWriterSettings)
Initializes a new instance of the BsonDocumentWriter class.
Top
Properties
  NameDescription
Public propertyDisposed
Gets whether the BsonWriter has been disposed.
(Inherited from BsonWriter.)
Public propertyDocument
Gets the BsonDocument being written to.
Protected propertyName
Gets the name of the element being written.
(Inherited from BsonWriter.)
Public propertyPosition
Gets the position. Not all writers are able to report the position. Those that can't simply return zero.
(Overrides BsonWriter.Position.)
Public propertySerializationDepth
Gets the current serialization depth.
(Inherited from BsonWriter.)
Public propertySettings
Gets the settings of the writer.
(Inherited from BsonWriter.)
Public propertyState
Gets the current state of the writer.
(Inherited from BsonWriter.)
Top
Methods
  NameDescription
Public methodClose
Closes the writer.
(Overrides BsonWriter.Close().)
Public methodDispose()
Disposes of any resources used by the writer.
(Inherited from BsonWriter.)
Protected methodDispose(Boolean)
Disposes of any resources used by the writer.
(Overrides BsonWriter.Dispose(Boolean).)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFlush
Flushes any pending data to the output destination.
(Overrides BsonWriter.Flush().)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodPopElementNameValidator
Pops the element name validator.
(Inherited from BsonWriter.)
Public methodPopSettings
Pops the settings.
(Inherited from BsonWriter.)
Public methodPushElementNameValidator
Pushes the element name validator.
(Inherited from BsonWriter.)
Public methodPushSettings
Pushes new settings for the writer.
(Inherited from BsonWriter.)
Protected methodThrowInvalidContextType
Throws an InvalidOperationException when the method called is not valid for the current ContextType.
(Inherited from BsonWriter.)
Protected methodThrowInvalidState
Throws an InvalidOperationException when the method called is not valid for the current state.
(Inherited from BsonWriter.)
Public methodToString (Inherited from Object.)
Public methodWriteBinaryData
Writes BSON binary data to the writer.
(Overrides BsonWriter.WriteBinaryData(BsonBinaryData).)
Public methodWriteBoolean
Writes a BSON Boolean to the writer.
(Overrides BsonWriter.WriteBoolean(Boolean).)
Public methodWriteBytes
Writes BSON binary data to the writer.
(Overrides BsonWriter.WriteBytes(Byte[]).)
Public methodWriteDateTime
Writes a BSON DateTime to the writer.
(Overrides BsonWriter.WriteDateTime(Int64).)
Public methodWriteDecimal128
Writes a BSON Decimal128 to the writer.
(Overrides BsonWriter.WriteDecimal128(Decimal128).)
Public methodWriteDouble
Writes a BSON Double to the writer.
(Overrides BsonWriter.WriteDouble(Double).)
Public methodWriteEndArray
Writes the end of a BSON array to the writer.
(Overrides BsonWriter.WriteEndArray().)
Public methodWriteEndDocument
Writes the end of a BSON document to the writer.
(Overrides BsonWriter.WriteEndDocument().)
Public methodWriteInt32
Writes a BSON Int32 to the writer.
(Overrides BsonWriter.WriteInt32(Int32).)
Public methodWriteInt64
Writes a BSON Int64 to the writer.
(Overrides BsonWriter.WriteInt64(Int64).)
Public methodWriteJavaScript
Writes a BSON JavaScript to the writer.
(Overrides BsonWriter.WriteJavaScript(String).)
Public methodWriteJavaScriptWithScope
Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).
(Overrides BsonWriter.WriteJavaScriptWithScope(String).)
Public methodWriteMaxKey
Writes a BSON MaxKey to the writer.
(Overrides BsonWriter.WriteMaxKey().)
Public methodWriteMinKey
Writes a BSON MinKey to the writer.
(Overrides BsonWriter.WriteMinKey().)
Public methodWriteName
Writes the name of an element to the writer.
(Overrides BsonWriter.WriteName(String).)
Public methodWriteNull
Writes a BSON null to the writer.
(Overrides BsonWriter.WriteNull().)
Public methodWriteObjectId
Writes a BSON ObjectId to the writer.
(Overrides BsonWriter.WriteObjectId(ObjectId).)
Public methodWriteRawBsonArray
Writes a raw BSON array.
(Inherited from BsonWriter.)
Public methodWriteRawBsonDocument
Writes a raw BSON document.
(Inherited from BsonWriter.)
Public methodWriteRegularExpression
Writes a BSON regular expression to the writer.
(Overrides BsonWriter.WriteRegularExpression(BsonRegularExpression).)
Public methodWriteStartArray
Writes the start of a BSON array to the writer.
(Overrides BsonWriter.WriteStartArray().)
Public methodWriteStartDocument
Writes the start of a BSON document to the writer.
(Overrides BsonWriter.WriteStartDocument().)
Public methodWriteString
Writes a BSON String to the writer.
(Overrides BsonWriter.WriteString(String).)
Public methodWriteSymbol
Writes a BSON Symbol to the writer.
(Overrides BsonWriter.WriteSymbol(String).)
Public methodWriteTimestamp
Writes a BSON timestamp to the writer.
(Overrides BsonWriter.WriteTimestamp(Int64).)
Public methodWriteUndefined
Writes a BSON undefined to the writer.
(Overrides BsonWriter.WriteUndefined().)
Top
Extension Methods
  NameDescription
Public Extension MethodToBson
Serializes an object to a BSON byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument
Serializes an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson
Serializes an object to a JSON string.
(Defined by BsonExtensionMethods.)
Top
See Also