# Functions

AppendArray will append arr to dst and return the extended buffer.
AppendArrayElement will append a BSON array element using key and arr to dst and return the extended buffer.
AppendArrayElementStart appends an array element header and then the length bytes for an array, returning the index where the length starts.
AppendArrayEnd appends the null byte to an array and calculates the length, inserting that calculated length starting at index.
AppendArrayStart appends the length bytes to an array and then returns the index of the start of those length bytes.
AppendBinary will append subtype and b to dst and return the extended buffer.
AppendBinaryElement will append a BSON binary element using key, subtype, and b to dst and return the extended buffer.
AppendBoolean will append b to dst and return the extended buffer.
AppendBooleanElement will append a BSON boolean element using key and b to dst and return the extended buffer.
AppendCodeWithScope will append code and scope to dst and return the extended buffer.
AppendCodeWithScopeElement will append a BSON code with scope element using key, code, and scope to dst and return the extended buffer.
AppendDateTime will append dt to dst and return the extended buffer.
AppendDateTimeElement will append a BSON datetime element using key and dt to dst and return the extended buffer.
AppendDBPointer will append ns and oid to dst and return the extended buffer.
AppendDBPointerElement will append a BSON DBPointer element using key, ns, and oid to dst and return the extended buffer.
AppendDecimal128 will append d128 to dst and return the extended buffer.
AppendDecimal128Element will append a BSON primitive.28 element using key and d128 to dst and return the extended buffer.
AppendDocument will append doc to dst and return the extended buffer.
AppendDocumentElement will append a BSON embeded document element using key and doc to dst and return the extended buffer.
AppendDocumentElementStart writes a document element header and then reserves the length bytes.
AppendDocumentEnd writes the null byte for a document and updates the length of the document.
AppendDocumentStart reserves a document's length and returns the index where the length begins.
AppendDocumentStartInline functions the same as AppendDocumentStart but takes a pointer to the index int32 which allows this function to be used inline.
AppendDouble will append f to dst and return the extended buffer.
AppendDoubleElement will append a BSON double element using key and f to dst and return the extended buffer.
AppendHeader will append Type t and key to dst and return the extended buffer.
AppendInt32 will append i32 to dst and return the extended buffer.
AppendInt32Element will append a BSON int32 element using key and i32 to dst and return the extended buffer.
AppendInt64 will append i64 to dst and return the extended buffer.
AppendInt64Element will append a BSON int64 element using key and i64 to dst and return the extended buffer.
AppendJavaScript will append js to dst and return the extended buffer.
AppendJavaScriptElement will append a BSON JavaScript element using key and js to dst and return the extended buffer.
AppendKey will append key to dst and return the extended buffer.
AppendMaxKeyElement will append a BSON max key element using key to dst and return the extended buffer.
AppendMinKeyElement will append a BSON min key element using key to dst and return the extended buffer.
AppendNullElement will append a BSON null element using key to dst and return the extended buffer.
AppendObjectID will append oid to dst and return the extended buffer.
AppendObjectIDElement will append a BSON ObjectID element using key and oid to dst and return the extended buffer.
AppendRegex will append pattern and options to dst and return the extended buffer.
AppendRegexElement will append a BSON regex element using key, pattern, and options to dst and return the extended buffer.
AppendString will append s to dst and return the extended buffer.
AppendStringElement will append a BSON string element using key and val to dst and return the extended buffer.
AppendSymbol will append symbol to dst and return the extended buffer.
AppendSymbolElement will append a BSON symbol element using key and symbol to dst and return the extended buffer.
AppendTime will append time as a BSON DateTime to dst and return the extended buffer.
AppendTimeElement will append a BSON datetime element using key and dt to dst and return the extended buffer.
AppendTimestamp will append t and i to dst and return the extended buffer.
AppendTimestampElement will append a BSON timestamp element using key, t, and i to dst and return the extended buffer.
AppendType will append t to dst and return the extended buffer.
AppendUndefinedElement will append a BSON undefined element using key to dst and return the extended buffer.
BuildDocument will create a document with the given elements and will append it to dst.
BuildDocumentFromElements will create a document with the given slice of elements and will append it to dst and return the extended buffer.
EqualValue will return true if the two values are equal.
NewDocumentFromReader reads a document from r.
NewDocumentLengthError creates and returns an error for when the length of a document exceeds the bytes available.
NewInsufficientBytesError creates a new InsufficientBytesError with the given Document, remaining bytes, and the current stack.
ReadArray will read an array from src.
ReadBinary will read a subtype and bin from src.
ReadBoolean will read a bool from src.
ReadCodeWithScope will read code and scope from src.
ReadDateTime will read an int64 datetime from src.
ReadDBPointer will read a ns and oid from src.
ReadDecimal128 will read a primitive.Decimal128 from src.
ReadDocument will read a document from src.
ReadDouble will read a float64 from src.
ReadElement reads the next full element from src.
ReadHeader will read a type byte and a key from src.
ReadHeaderBytes will read a type and a key from src and the remainder of the bytes are returned as rem.
ReadInt32 will read an int32 from src.
ReadInt64 will read an int64 from src.
ReadJavaScript will read a js string from src.
ReadKey will read a key from src.
ReadKeyBytes will read a key from src as bytes.
ReadLength reads an int32 length from src and returns the length and the remaining bytes.
ReadObjectID will read an ObjectID from src.
ReadRegex will read a pattern and options from src.
ReadString will read a string from src.
ReadSymbol will read a symbol string from src.
ReadTime will read an time.Time datetime from src.
ReadTimestamp will read t and i from src.
ReadType will return the first byte of the provided []byte as a type.
ReadValue reads the next value as the provided types and returns a Value, the remaining bytes, and a boolean indicating if the read was successful.
ReserveLength reserves the space required for length and returns the index where to write the length and the []byte with reserved space.
UpdateLength updates the length at index with length and returns the []byte.

# Constants

These constants are the valid styles for a DocumentSequence.
ErrElementMissingKey is returned when a RawElement is missing a key.
ErrElementMissingType is returned when a RawElement is missing a type.
ErrMissingNull is returned when a document's last byte is not null.
These constants are the valid styles for a DocumentSequence.

# Variables

ErrCorruptedDocument is returned when a full document couldn't be read from the sequence.
ErrElementNotFound indicates that an Element matching a certain condition does not exist.
ErrEmptyKey indicates that no key was provided to a Lookup method.
ErrInvalidDocumentSequenceStyle is returned when an unknown DocumentSequenceStyle is set on a DocumentSequence.
ErrInvalidLength indicates that a length in a binary representation of a BSON document is invalid.
ErrNilReader indicates that an operation was attempted on a nil io.Reader.
ErrNonDocument is returned when a DocumentSequence contains a non-document BSON value.
ErrOutOfBounds indicates that an index provided to access something was invalid.

# Structs

DocumentSequence represents a sequence of documents.
ElementTypeError specifies that a method to obtain a BSON value an incorrect type was called on a bson.Value.
InsufficientBytesError indicates that there were not enough bytes to read the next component.
InvalidDepthTraversalError is returned when attempting a recursive Lookup when one component of the path is neither an embedded document nor an array.
Value represents a BSON value with a type and raw bytes.

# Type aliases

Document is a raw bytes representation of a BSON document.
DocumentSequenceStyle is used to represent how a document sequence is laid out in a slice of bytes.
DocumentValidationError is an error type returned when attempting to validate a document.
Element is a raw bytes representation of a BSON element.
MalformedElementError represents a class of errors that RawElement methods return.