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
Have feedback on this page?
Open GitHub IssueLast updated on Dec 4, 2025