Go is in development for v1. Interested in contributing or chatting with us?Get in touch!
Go - Collection.Doc()
Get a reference to a document in the collection.
import (
  "fmt"
  "github.com/nitrictech/go-sdk/nitric"
)
func main() {
  profiles, err := nitric.NewCollection("profiles").With(nitric.CollectionReading, nitric.CollectionWriting)
  if err != nil {
    return
  }
  drakeProfileRef := profiles.Doc("Drake Mallard")
  if err := nitric.Run(); err != nil {
    fmt.Println(err)
  }
}
Parameters
- Name
 key- Required
 - Required
 - Type
 - string
 - Description
 The key of the document to reference.