We add the features to insert documents into a collection using the Collection.Add-method. The implementation follows the MySQL X DevAPI used by other MySQL connectors.
Example:
type Person struct {
Name string `json:"name"`
Age int `json:"age"`
}
myColl, _ := db.CreateCollection("my_collection");
err := myColl.Add(&Person{Name: "Laurie", Age: 19 }).
Add(&Person{Name: "Nadya", Age: 54 }, &Person{Name: "Lucas", Age: 32 }).
Execute(context.Background())
We add the features to insert documents into a collection using the
Collection.Add
-method. The implementation follows the MySQL X DevAPI used by other MySQL connectors.Example:
Currently only struct type object can be added.
Resolves #66