Documentation
¶
Index ¶
Constants ¶
View Source
const ( BinaryGeneric = BinarySubtype(0x00) // generic BinaryFunction = BinarySubtype(0x01) // function BinaryGenericOld = BinarySubtype(0x02) // generic-old BinaryUUIDOld = BinarySubtype(0x03) // uuid-old BinaryUUID = BinarySubtype(0x04) // uuid BinaryMD5 = BinarySubtype(0x05) // md5 BinaryEncrypted = BinarySubtype(0x06) // encrypted BinaryUser = BinarySubtype(0x80) // user )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binary ¶
type Binary struct {
Subtype BinarySubtype
B []byte
}
type BinarySubtype ¶
type BinarySubtype byte
func (BinarySubtype) String ¶
func (i BinarySubtype) String() string
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document represents BSON document.
Duplicate field names are not supported.
func ConvertDocument ¶
ConvertDocument converts bson.Document to types.Document and validates it. It references the same data without copying it.
func MakeDocument ¶
MakeDocument makes a new Document from given key/value pairs.
func MustConvertDocument ¶
func MustConvertDocument(d document) Document
MustConvertDocument is a ConvertDocument that panics in case of error.
func MustMakeDocument ¶
func MustMakeDocument(pairs ...interface{}) Document
MustMakeDocument is a MakeDocument that panics in case of error.
func (Document) Command ¶
Command returns the first document's key, this is often used as a command name.
Click to show internal directories.
Click to hide internal directories.