Answers for "struct to bson d golang"

Go
0

golang struct to bson.d

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

    err = bson.Unmarshal(data, &doc)
    return
}
Posted by: Guest on May-05-2020

Code answers related to "struct to bson d golang"

Browse Popular Code Answers by Language