📌  相关文章
📜  golang struct to bson.d - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:45:00.627000             🧑  作者: Mango

代码示例1
func toDoc(v interface{}) (doc *bson.Document, err error) {
    data, err := bson.Marshal(v)
    if err != nil {
        return
    }

    err = bson.Unmarshal(data, &doc)
    return
}