## copy() function

The "copy" operation copies the value at a specified location to the target location. The operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to copy the value from. The "from" location MUST exist for the operation to be successful.

This operation is functionally identical to an "add" operation at the target location using the value specified in the "from" member.

Alternatively, it's like 'move' without the 'remove'.

**Signature:**

```typescript
export declare function copy(object: any, operation: CopyOperation, _options?: PatchOptions): MissingError | null;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| object | any | The object being patched. |
| operation | [CopyOperation](/content/docs/sdk/core.copyoperation) | The operation to perform on the object. |
| _options | [PatchOptions](/content/docs/sdk/core.patchoptions) | _(Optional)_ Optional params. |

**Returns:**

[MissingError](/content/docs/sdk/core.missingerror) | null

null on success, or error if one occurred.

- [copy() function](/content/docs/sdk/core.copy#copy-function/index.html)
- [Parameters](/content/docs/sdk/core.copy#parameters/index.html)
