.Create[T](table, data)
Creates a record in the database.
Method Syntaxdb.Create[T](table, data)
Arguments | Description | ||
---|---|---|---|
table required | The table name or a | ||
data optional | The document / record data to insert. |
// Create an entry person1, err := surrealdb.Create[Person](db, models.Table("persons"), map[interface{}]interface{}{ "Name": "John", "Surname": "Doe", "Location": models.NewGeometryPoint(-0.11, 22.00), }) if err != nil { panic(err) } fmt.Printf("Created person with a map: %+v\n", person1)