Documentation
¶
Index ¶
- func Marshal(in interface{}) (out []byte, err error)
- func NewEncoder(w io.Writer) *gbson.Encoder
- func NewToSearchValue(v interface{}) (b toSearchValue, err error)
- func ReadOne(r io.Reader) (one []byte, err error)
- func Unmarshal(in []byte, out interface{}) (err error)
- type BSON
- func (b BSON) FastContains(v toSearchValue) bool
- func (b BSON) Lookup(key string) (val Value)
- func (b BSON) Map() (m M, err error)
- func (b BSON) MustToJson() (s []byte)
- func (b BSON) String() string
- func (b BSON) ToJson() (s []byte, err error)
- func (b BSON) ToValueMap() (vals map[string]interface{})
- func (b BSON) Unmarshal(out interface{}) (err error)
- type BSONEX
- type Binary
- type Decoder
- type M
- type Value
- func (v Value) ArrayOf(i int) Value
- func (v Value) Binary() Binary
- func (v Value) Bool() bool
- func (v Value) DBPointer() gbson.DBPointer
- func (v Value) Document() BSON
- func (v Value) Float64() float64
- func (v Value) Int32() int32
- func (v Value) Int64() int64
- func (v Value) IsEmpty() bool
- func (v Value) IsMaxKey() bool
- func (v Value) IsMinKey() bool
- func (v Value) IsNull() bool
- func (v Value) IsUndefined() bool
- func (v Value) Kind() byte
- func (v Value) MongoTimestamp() gbson.MongoTimestamp
- func (v Value) Objid() gbson.ObjectId
- func (v Value) RawValue() []byte
- func (v Value) Regexp() gbson.RegEx
- func (v Value) Str() string
- func (v Value) String() string
- func (v Value) Time() time.Time
- func (v Value) Type() byte
- func (v Value) Uint32() uint32
- func (v Value) Uint64() uint64
- func (v Value) Value() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewToSearchValue ¶ added in v1.1.0
func NewToSearchValue(v interface{}) (b toSearchValue, err error)
Types ¶
type BSON ¶
type BSON []byte
func (BSON) FastContains ¶ added in v1.1.0
Contains 可以在未解析BSON的时候先快速判断一下是否包含待查找的内容, 避免执行每个文档都执行Unmarshal加快查找速度。 需要注意的是这里查找并不精确,必要的情况下仍然需要再次Unmarshal再确认一次。
func (BSON) MustToJson ¶
func (BSON) ToValueMap ¶
type Binary ¶
func (Binary) MarshalJSON ¶
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func (Value) IsUndefined ¶
func (Value) MongoTimestamp ¶
func (v Value) MongoTimestamp() gbson.MongoTimestamp
Click to show internal directories.
Click to hide internal directories.