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")
nitric.Run()
}

Parameters

  • Name
    key
    Required
    Required
    Type
    string
    Description

    The key of the document to reference.

See also

Last updated on Mar 24, 2025