method
HookContext.Candidate
Candidate returns the values the document will have once this write is saved: Original's values with each top-level entry of Data in their place. On a create it is a copy of Data. Use it to read a field whether or not the caller sent it, for example to check a rule that spans two fields on a partial update. The map is a detached copy; change Data, not the result, to change what is saved.
Returns
The declared result.
store.ValuesFull signature
func (ctx HookContext) Candidate() store.ValuesRelated types
HookContextHookContext supplies the request, values, and local API to a collection or global hook. Change entries in Data before saving, or values in Document to change the response after saving. A Hook returns only an error.
ValuesA map of field names to typed values.