Skip to content

Function: applyPatch() ​

ts
function applyPatch(
   documentData, 
   path, 
   value, 
   ctx
): DocumentData;

Defined in: domain/shadow-model.ts:169

Returns a copy of the document data with value written at path. The value is coerced to the schema type at that path and the result is normalized again. The input data is not modified.

Parameters ​

ParameterType
documentDataDocumentData
path(string | number)[]
valueany
ctxSchemaContext

Returns ​

DocumentData